@me1a/ui 2.2.1 → 2.2.3
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/dist/accordion/index.d.mts +94 -0
- package/dist/accordion/index.mjs +2 -0
- package/dist/accordion/index.mjs.map +1 -0
- package/dist/avatar/index.d.mts +34 -0
- package/dist/avatar/index.mjs +2 -0
- package/dist/avatar/index.mjs.map +1 -0
- package/dist/badge/index.d.mts +41 -0
- package/dist/badge/index.mjs +2 -0
- package/dist/badge/index.mjs.map +1 -0
- package/dist/box/index.d.mts +50 -0
- package/dist/box/index.mjs +2 -0
- package/dist/box/index.mjs.map +1 -0
- package/dist/breadcrumb/index.d.mts +35 -0
- package/dist/breadcrumb/index.mjs +2 -0
- package/dist/breadcrumb/index.mjs.map +1 -0
- package/dist/{tooltip-B4jzaurK.d.mts → button/index.d.mts} +3 -25
- package/dist/button/index.mjs +2 -0
- package/dist/button/index.mjs.map +1 -0
- package/dist/card/index.d.mts +127 -0
- package/dist/card/index.mjs +2 -0
- package/dist/card/index.mjs.map +1 -0
- package/dist/checkbox/index.d.mts +21 -0
- package/dist/checkbox/index.mjs +2 -0
- package/dist/checkbox/index.mjs.map +1 -0
- package/dist/collapsible/index.d.mts +26 -0
- package/dist/collapsible/index.mjs +2 -0
- package/dist/collapsible/index.mjs.map +1 -0
- package/dist/command/index.d.mts +122 -0
- package/dist/command/index.mjs +2 -0
- package/dist/command/index.mjs.map +1 -0
- package/dist/container/index.d.mts +33 -0
- package/dist/container/index.mjs +2 -0
- package/dist/container/index.mjs.map +1 -0
- package/dist/dialog/index.d.mts +35 -0
- package/dist/dialog/index.mjs +2 -0
- package/dist/dialog/index.mjs.map +1 -0
- package/dist/drawer/index.d.mts +63 -0
- package/dist/drawer/index.mjs +2 -0
- package/dist/drawer/index.mjs.map +1 -0
- package/dist/dropdown-menu/index.d.mts +335 -0
- package/dist/dropdown-menu/index.mjs +2 -0
- package/dist/dropdown-menu/index.mjs.map +1 -0
- package/dist/form/index.d.mts +96 -0
- package/dist/form/index.mjs +2 -0
- package/dist/form/index.mjs.map +1 -0
- package/dist/{hooks.d.mts → hooks/index.d.mts} +10 -4
- package/dist/hooks/index.mjs +2 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/index.d.mts +2739 -30
- package/dist/index.mjs +47 -0
- package/dist/{index.esm.js.map → index.mjs.map} +1 -1
- package/dist/input/index.d.mts +12 -0
- package/dist/input/index.mjs +2 -0
- package/dist/input/index.mjs.map +1 -0
- package/dist/label/index.d.mts +18 -0
- package/dist/label/index.mjs +2 -0
- package/dist/label/index.mjs.map +1 -0
- package/dist/navigation-menu/index.d.mts +104 -0
- package/dist/navigation-menu/index.mjs +2 -0
- package/dist/navigation-menu/index.mjs.map +1 -0
- package/dist/page-loader/index.d.mts +29 -0
- package/dist/page-loader/index.mjs +2 -0
- package/dist/page-loader/index.mjs.map +1 -0
- package/dist/pagination/index.d.mts +105 -0
- package/dist/pagination/index.mjs +2 -0
- package/dist/pagination/index.mjs.map +1 -0
- package/dist/popover/index.d.mts +30 -0
- package/dist/popover/index.mjs +2 -0
- package/dist/popover/index.mjs.map +1 -0
- package/dist/{checkbox-DxgDKaHx.d.mts → radio-group/index.d.mts} +5 -51
- package/dist/radio-group/index.mjs +2 -0
- package/dist/radio-group/index.mjs.map +1 -0
- package/dist/resizable/index.d.mts +53 -0
- package/dist/resizable/index.mjs +2 -0
- package/dist/resizable/index.mjs.map +1 -0
- package/dist/rhf-checkbox/index.d.mts +57 -0
- package/dist/rhf-checkbox/index.mjs +2 -0
- package/dist/rhf-checkbox/index.mjs.map +1 -0
- package/dist/rhf-multi-select/index.d.mts +84 -0
- package/dist/rhf-multi-select/index.mjs +2 -0
- package/dist/rhf-multi-select/index.mjs.map +1 -0
- package/dist/rhf-radio-button-group/index.d.mts +73 -0
- package/dist/rhf-radio-button-group/index.mjs +2 -0
- package/dist/rhf-radio-button-group/index.mjs.map +1 -0
- package/dist/rhf-radio-group/index.d.mts +103 -0
- package/dist/rhf-radio-group/index.mjs +2 -0
- package/dist/rhf-radio-group/index.mjs.map +1 -0
- package/dist/rhf-select/index.d.mts +80 -0
- package/dist/rhf-select/index.mjs +2 -0
- package/dist/rhf-select/index.mjs.map +1 -0
- package/dist/rhf-switch/index.d.mts +57 -0
- package/dist/rhf-switch/index.mjs +2 -0
- package/dist/rhf-switch/index.mjs.map +1 -0
- package/dist/rhf-textarea/index.d.mts +66 -0
- package/dist/rhf-textarea/index.mjs +2 -0
- package/dist/rhf-textarea/index.mjs.map +1 -0
- package/dist/separator/index.d.mts +13 -0
- package/dist/separator/index.mjs +2 -0
- package/dist/separator/index.mjs.map +1 -0
- package/dist/sheet/index.d.mts +42 -0
- package/dist/sheet/index.mjs +2 -0
- package/dist/sheet/index.mjs.map +1 -0
- package/dist/sidebar/index.d.mts +328 -0
- package/dist/sidebar/index.mjs +2 -0
- package/dist/sidebar/index.mjs.map +1 -0
- package/dist/skeleton/index.d.mts +17 -0
- package/dist/skeleton/index.mjs +2 -0
- package/dist/skeleton/index.mjs.map +1 -0
- package/dist/stack/index.d.mts +121 -0
- package/dist/stack/index.mjs +2 -0
- package/dist/stack/index.mjs.map +1 -0
- package/dist/switch/index.d.mts +21 -0
- package/dist/switch/index.mjs +2 -0
- package/dist/switch/index.mjs.map +1 -0
- package/dist/table/index.d.mts +53 -0
- package/dist/table/index.mjs +2 -0
- package/dist/table/index.mjs.map +1 -0
- package/dist/tabs/index.d.mts +97 -0
- package/dist/tabs/index.mjs +2 -0
- package/dist/tabs/index.mjs.map +1 -0
- package/dist/text-field/index.d.mts +65 -0
- package/dist/text-field/index.mjs +2 -0
- package/dist/text-field/index.mjs.map +1 -0
- package/dist/textarea/index.d.mts +24 -0
- package/dist/textarea/index.mjs +2 -0
- package/dist/textarea/index.mjs.map +1 -0
- package/dist/{toast-2xT7L1tJ.d.mts → toast/index.d.mts} +3 -3
- package/dist/toast/index.mjs +2 -0
- package/dist/toast/index.mjs.map +1 -0
- package/dist/toaster/index.d.mts +26 -0
- package/dist/toaster/index.mjs +2 -0
- package/dist/toaster/index.mjs.map +1 -0
- package/dist/tooltip/index.d.mts +25 -0
- package/dist/tooltip/index.mjs +2 -0
- package/dist/tooltip/index.mjs.map +1 -0
- package/dist/types/index.mjs +2 -0
- package/dist/{index.cjs.js.map → types/index.mjs.map} +1 -1
- package/dist/typography/index.d.mts +24 -0
- package/dist/typography/index.mjs +2 -0
- package/dist/typography/index.mjs.map +1 -0
- package/dist/utils/index.mjs +2 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +199 -34
- package/dist/atoms.cjs.js +0 -2
- package/dist/atoms.cjs.js.map +0 -1
- package/dist/atoms.d.mts +0 -1051
- package/dist/atoms.d.ts +0 -1051
- package/dist/atoms.esm.js +0 -2
- package/dist/atoms.esm.js.map +0 -1
- package/dist/checkbox-DxgDKaHx.d.ts +0 -108
- package/dist/chunk-23T2PH5G.esm.js +0 -2
- package/dist/chunk-23T2PH5G.esm.js.map +0 -1
- package/dist/chunk-2QG3QTSW.cjs.js +0 -2
- package/dist/chunk-2QG3QTSW.cjs.js.map +0 -1
- package/dist/chunk-C26U3FL4.esm.js +0 -2
- package/dist/chunk-C26U3FL4.esm.js.map +0 -1
- package/dist/chunk-DTM5LZHM.cjs.js +0 -2
- package/dist/chunk-DTM5LZHM.cjs.js.map +0 -1
- package/dist/chunk-HW32JE75.cjs.js +0 -2
- package/dist/chunk-HW32JE75.cjs.js.map +0 -1
- package/dist/chunk-JIRS6MWF.cjs.js +0 -2
- package/dist/chunk-JIRS6MWF.cjs.js.map +0 -1
- package/dist/chunk-JKTYFZ5M.esm.js +0 -2
- package/dist/chunk-JKTYFZ5M.esm.js.map +0 -1
- package/dist/chunk-JUZG25DH.esm.js +0 -2
- package/dist/chunk-JUZG25DH.esm.js.map +0 -1
- package/dist/chunk-KOYJODOP.cjs.js +0 -2
- package/dist/chunk-KOYJODOP.cjs.js.map +0 -1
- package/dist/chunk-M4S5YZ56.esm.js +0 -2
- package/dist/chunk-M4S5YZ56.esm.js.map +0 -1
- package/dist/chunk-MOYOCJW6.esm.js +0 -2
- package/dist/chunk-MOYOCJW6.esm.js.map +0 -1
- package/dist/chunk-MVWMLXLL.cjs.js +0 -2
- package/dist/chunk-MVWMLXLL.cjs.js.map +0 -1
- package/dist/chunk-SL2ZUI4G.cjs.js +0 -2
- package/dist/chunk-SL2ZUI4G.cjs.js.map +0 -1
- package/dist/chunk-STRDPP3B.esm.js +0 -2
- package/dist/chunk-STRDPP3B.esm.js.map +0 -1
- package/dist/chunk-U4NMIMU7.esm.js +0 -2
- package/dist/chunk-U4NMIMU7.esm.js.map +0 -1
- package/dist/chunk-UK47BFA3.cjs.js +0 -2
- package/dist/chunk-UK47BFA3.cjs.js.map +0 -1
- package/dist/chunk-UTVXFZLD.esm.js +0 -2
- package/dist/chunk-UTVXFZLD.esm.js.map +0 -1
- package/dist/chunk-WJNYKJP6.cjs.js +0 -2
- package/dist/chunk-WJNYKJP6.cjs.js.map +0 -1
- package/dist/chunk-YEZB7AOJ.esm.js +0 -2
- package/dist/chunk-YEZB7AOJ.esm.js.map +0 -1
- package/dist/chunk-YGLYFSF6.cjs.js +0 -2
- package/dist/chunk-YGLYFSF6.cjs.js.map +0 -1
- package/dist/hooks.cjs.js +0 -2
- package/dist/hooks.cjs.js.map +0 -1
- package/dist/hooks.d.ts +0 -51
- package/dist/hooks.esm.js +0 -2
- package/dist/hooks.esm.js.map +0 -1
- package/dist/index.cjs.js +0 -2
- package/dist/index.d.ts +0 -30
- package/dist/index.esm.js +0 -2
- package/dist/molecules.cjs.js +0 -2
- package/dist/molecules.cjs.js.map +0 -1
- package/dist/molecules.d.mts +0 -201
- package/dist/molecules.d.ts +0 -201
- package/dist/molecules.esm.js +0 -2
- package/dist/molecules.esm.js.map +0 -1
- package/dist/organisms.cjs.js +0 -2
- package/dist/organisms.cjs.js.map +0 -1
- package/dist/organisms.d.mts +0 -673
- package/dist/organisms.d.ts +0 -673
- package/dist/organisms.esm.js +0 -2
- package/dist/organisms.esm.js.map +0 -1
- package/dist/rhf.cjs.js +0 -2
- package/dist/rhf.cjs.js.map +0 -1
- package/dist/rhf.d.mts +0 -408
- package/dist/rhf.d.ts +0 -408
- package/dist/rhf.esm.js +0 -2
- package/dist/rhf.esm.js.map +0 -1
- package/dist/toast-2xT7L1tJ.d.ts +0 -18
- package/dist/tooltip-B4jzaurK.d.ts +0 -104
- package/dist/types.cjs.js +0 -2
- package/dist/types.cjs.js.map +0 -1
- package/dist/types.d.ts +0 -2
- package/dist/types.esm.js +0 -2
- package/dist/types.esm.js.map +0 -1
- package/dist/utils.cjs.js +0 -2
- package/dist/utils.cjs.js.map +0 -1
- package/dist/utils.d.ts +0 -5
- package/dist/utils.esm.js +0 -2
- package/dist/utils.esm.js.map +0 -1
- /package/dist/{types.d.mts → types/index.d.mts} +0 -0
- /package/dist/{utils.d.mts → utils/index.d.mts} +0 -0
package/dist/rhf.d.ts
DELETED
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as react_hook_form from 'react-hook-form';
|
|
3
|
-
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { TextareaHTMLAttributes } from 'react';
|
|
6
|
-
import { I as Input, C as Checkbox, S as Switch, R as RadioGroup } from './checkbox-DxgDKaHx.js';
|
|
7
|
-
import * as _radix_ui_react_slot from '@radix-ui/react-slot';
|
|
8
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
9
|
-
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
10
|
-
import '@radix-ui/react-switch';
|
|
11
|
-
import 'class-variance-authority/types';
|
|
12
|
-
import 'class-variance-authority';
|
|
13
|
-
import '@radix-ui/react-radio-group';
|
|
14
|
-
import '@radix-ui/react-checkbox';
|
|
15
|
-
|
|
16
|
-
interface RHFTextFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Input>, "name"> {
|
|
17
|
-
/** The name of the field in the form */
|
|
18
|
-
name: TName;
|
|
19
|
-
/** Optional label for the field */
|
|
20
|
-
label?: string;
|
|
21
|
-
/** Optional description text below the field */
|
|
22
|
-
description?: string;
|
|
23
|
-
/** Optional warning text to display */
|
|
24
|
-
warningText?: string;
|
|
25
|
-
/** Whether the field is required */
|
|
26
|
-
required?: boolean;
|
|
27
|
-
/** Whether the field is disabled */
|
|
28
|
-
disabled?: boolean;
|
|
29
|
-
/** Whether the field is read-only */
|
|
30
|
-
readOnly?: boolean;
|
|
31
|
-
/** The type of input (text, number, email, etc.) */
|
|
32
|
-
type?: React.HTMLInputTypeAttribute;
|
|
33
|
-
/** Optional placeholder text */
|
|
34
|
-
placeholder?: string;
|
|
35
|
-
/** Optional aria-label for accessibility */
|
|
36
|
-
"aria-label"?: string;
|
|
37
|
-
/** Optional aria-describedby for accessibility */
|
|
38
|
-
"aria-describedby"?: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* A text field component that integrates with React Hook Form.
|
|
43
|
-
* Provides form validation, error handling, and accessibility features.
|
|
44
|
-
*
|
|
45
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextfield--docs
|
|
46
|
-
*
|
|
47
|
-
* * @example
|
|
48
|
-
* ```tsx
|
|
49
|
-
* <Form>
|
|
50
|
-
* <RHFTextField name="name" label="Name" />
|
|
51
|
-
* <RHFTextField name="email" label="Email" />
|
|
52
|
-
* </Form>
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
declare function RHFTextField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, type, warningText, required, disabled, readOnly, placeholder, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, onBlur, ...other }: RHFTextFieldProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
56
|
-
|
|
57
|
-
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
58
|
-
/**
|
|
59
|
-
* Whether the textarea should automatically resize
|
|
60
|
-
*/
|
|
61
|
-
autoResize?: boolean;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Textarea component for creating accessible text areas.
|
|
66
|
-
* Built on top of shadcn/ui's Textarea component.
|
|
67
|
-
*
|
|
68
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-textarea--docs
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* ```tsx
|
|
72
|
-
* <Textarea placeholder="Enter text" />
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
76
|
-
|
|
77
|
-
interface RHFTextareaProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Textarea>, "name"> {
|
|
78
|
-
/** The name of the field in the form */
|
|
79
|
-
name: TName;
|
|
80
|
-
/** Optional label for the field */
|
|
81
|
-
label?: string;
|
|
82
|
-
/** Optional description text below the field */
|
|
83
|
-
description?: string;
|
|
84
|
-
/** Optional warning text to display */
|
|
85
|
-
warningText?: string;
|
|
86
|
-
/** Whether the field is required */
|
|
87
|
-
required?: boolean;
|
|
88
|
-
/** Whether the field is disabled */
|
|
89
|
-
disabled?: boolean;
|
|
90
|
-
/** Whether the field is read-only */
|
|
91
|
-
readOnly?: boolean;
|
|
92
|
-
/** Optional placeholder text */
|
|
93
|
-
placeholder?: string;
|
|
94
|
-
/** Optional aria-label for accessibility */
|
|
95
|
-
"aria-label"?: string;
|
|
96
|
-
/** Optional aria-describedby for accessibility */
|
|
97
|
-
"aria-describedby"?: string;
|
|
98
|
-
/** Whether the textarea should automatically resize */
|
|
99
|
-
autoResize?: boolean;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* A textarea component that integrates with React Hook Form.
|
|
104
|
-
* Provides form validation, error handling, and accessibility features.
|
|
105
|
-
*
|
|
106
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextarea--docs
|
|
107
|
-
*
|
|
108
|
-
* @example
|
|
109
|
-
* ```tsx
|
|
110
|
-
* <Form>
|
|
111
|
-
* <RHFTextarea name="description" label="Description" />
|
|
112
|
-
* </Form>
|
|
113
|
-
* ```
|
|
114
|
-
*/
|
|
115
|
-
declare function RHFTextarea<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, placeholder, autoResize, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, onBlur, ...other }: RHFTextareaProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
116
|
-
|
|
117
|
-
interface RHFCheckboxProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Checkbox>, "name"> {
|
|
118
|
-
/** The name of the field in the form */
|
|
119
|
-
name: TName;
|
|
120
|
-
/** Optional label for the field */
|
|
121
|
-
label?: string;
|
|
122
|
-
/** Optional description text below the field */
|
|
123
|
-
description?: string;
|
|
124
|
-
/** Optional warning text to display */
|
|
125
|
-
warningText?: string;
|
|
126
|
-
/** Whether the field is required */
|
|
127
|
-
required?: boolean;
|
|
128
|
-
/** Whether the field is disabled */
|
|
129
|
-
disabled?: boolean;
|
|
130
|
-
/** Whether the field is read-only */
|
|
131
|
-
readOnly?: boolean;
|
|
132
|
-
/** Optional aria-label for accessibility */
|
|
133
|
-
"aria-label"?: string;
|
|
134
|
-
/** Optional aria-describedby for accessibility */
|
|
135
|
-
"aria-describedby"?: string;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* A checkbox component that integrates with React Hook Form.
|
|
140
|
-
* Provides form validation, error handling, and accessibility features.
|
|
141
|
-
*
|
|
142
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfcheckbox--docs
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* ```tsx
|
|
146
|
-
* <Form>
|
|
147
|
-
* <RHFCheckbox name="terms" label="Accept terms and conditions" />
|
|
148
|
-
* </Form>
|
|
149
|
-
* ```
|
|
150
|
-
*/
|
|
151
|
-
declare function RHFCheckbox<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, ...other }: RHFCheckboxProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
152
|
-
|
|
153
|
-
interface RHFSwitchProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof Switch>, "name"> {
|
|
154
|
-
/** The name of the field in the form */
|
|
155
|
-
name: TName;
|
|
156
|
-
/** Optional label for the field */
|
|
157
|
-
label?: string;
|
|
158
|
-
/** Optional description text below the field */
|
|
159
|
-
description?: string;
|
|
160
|
-
/** Optional warning text to display */
|
|
161
|
-
warningText?: string;
|
|
162
|
-
/** Whether the field is required */
|
|
163
|
-
required?: boolean;
|
|
164
|
-
/** Whether the field is disabled */
|
|
165
|
-
disabled?: boolean;
|
|
166
|
-
/** Whether the field is read-only */
|
|
167
|
-
readOnly?: boolean;
|
|
168
|
-
/** Optional aria-label for accessibility */
|
|
169
|
-
"aria-label"?: string;
|
|
170
|
-
/** Optional aria-describedby for accessibility */
|
|
171
|
-
"aria-describedby"?: string;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* A switch component that integrates with React Hook Form.
|
|
176
|
-
* Provides form validation, error handling, and accessibility features.
|
|
177
|
-
*
|
|
178
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfswitch--docs
|
|
179
|
-
*
|
|
180
|
-
* @example
|
|
181
|
-
* ```tsx
|
|
182
|
-
* <Form>
|
|
183
|
-
* <RHFSwitch name="notifications" label="Enable notifications" />
|
|
184
|
-
* </Form>
|
|
185
|
-
* ```
|
|
186
|
-
*/
|
|
187
|
-
declare function RHFSwitch<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, ...other }: RHFSwitchProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
188
|
-
|
|
189
|
-
interface RHFRadioGroupOption {
|
|
190
|
-
label: string;
|
|
191
|
-
id: string;
|
|
192
|
-
}
|
|
193
|
-
interface RHFRadioGroupWithChildrenProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof RadioGroup>, "name"> {
|
|
194
|
-
/** The name of the field in the form */
|
|
195
|
-
name: TName;
|
|
196
|
-
/** Optional label for the field */
|
|
197
|
-
label?: string;
|
|
198
|
-
/** Optional description text below the field */
|
|
199
|
-
description?: string;
|
|
200
|
-
/** Optional warning text to display */
|
|
201
|
-
warningText?: string;
|
|
202
|
-
/** Whether the field is required */
|
|
203
|
-
required?: boolean;
|
|
204
|
-
/** Whether the field is disabled */
|
|
205
|
-
disabled?: boolean;
|
|
206
|
-
/** Whether the field is read-only */
|
|
207
|
-
readOnly?: boolean;
|
|
208
|
-
/** Optional aria-label for accessibility */
|
|
209
|
-
"aria-label"?: string;
|
|
210
|
-
/** Optional aria-describedby for accessibility */
|
|
211
|
-
"aria-describedby"?: string;
|
|
212
|
-
/** Children must be RadioGroupItem components */
|
|
213
|
-
children: React.ReactNode;
|
|
214
|
-
}
|
|
215
|
-
interface RHFRadioGroupWithOptionsProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof RadioGroup>, "name"> {
|
|
216
|
-
/** The name of the field in the form */
|
|
217
|
-
name: TName;
|
|
218
|
-
/** Optional label for the field */
|
|
219
|
-
label?: string;
|
|
220
|
-
/** radio group options */
|
|
221
|
-
options: RHFRadioGroupOption[];
|
|
222
|
-
/** Optional description text below the field */
|
|
223
|
-
description?: string;
|
|
224
|
-
/** Optional warning text to display */
|
|
225
|
-
warningText?: string;
|
|
226
|
-
/** Whether the field is required */
|
|
227
|
-
required?: boolean;
|
|
228
|
-
/** Whether the field is disabled */
|
|
229
|
-
disabled?: boolean;
|
|
230
|
-
/** Whether the field is read-only */
|
|
231
|
-
readOnly?: boolean;
|
|
232
|
-
/** Optional aria-label for accessibility */
|
|
233
|
-
"aria-label"?: string;
|
|
234
|
-
/** Optional aria-describedby for accessibility */
|
|
235
|
-
"aria-describedby"?: string;
|
|
236
|
-
}
|
|
237
|
-
type RHFRadioGroupProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = RHFRadioGroupWithChildrenProps<TFieldValues, TName> | RHFRadioGroupWithOptionsProps<TFieldValues, TName>;
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* A radio group component that integrates with React Hook Form.
|
|
241
|
-
* Provides form validation, error handling, and accessibility features.
|
|
242
|
-
*
|
|
243
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfradiogroup--docs
|
|
244
|
-
*
|
|
245
|
-
* @example
|
|
246
|
-
* ```tsx
|
|
247
|
-
* // Using children
|
|
248
|
-
* <Form>
|
|
249
|
-
* <RHFRadioGroup name="preference" label="Select your preference">
|
|
250
|
-
* <RadioGroupItem value="option1" label="Option 1" />
|
|
251
|
-
* <RadioGroupItem value="option2" label="Option 2" />
|
|
252
|
-
* </RHFRadioGroup>
|
|
253
|
-
* </Form>
|
|
254
|
-
*
|
|
255
|
-
* // Using options prop
|
|
256
|
-
* <Form>
|
|
257
|
-
* <RHFRadioGroup
|
|
258
|
-
* name="preference"
|
|
259
|
-
* label="Select your preference"
|
|
260
|
-
* options={[
|
|
261
|
-
* { id: "option1", label: "Option 1" },
|
|
262
|
-
* { id: "option2", label: "Option 2" }
|
|
263
|
-
* ]}
|
|
264
|
-
* />
|
|
265
|
-
* </Form>
|
|
266
|
-
* ```
|
|
267
|
-
*/
|
|
268
|
-
declare function RHFRadioGroup<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, children, ...other }: RHFRadioGroupProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
269
|
-
|
|
270
|
-
interface RHFRadioButtonGroupOption {
|
|
271
|
-
label: string;
|
|
272
|
-
id: string;
|
|
273
|
-
size?: "default" | "sm" | "lg";
|
|
274
|
-
}
|
|
275
|
-
interface RHFRadioButtonGroupProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Omit<React.ComponentProps<typeof RadioGroup>, "name"> {
|
|
276
|
-
/** The name of the field in the form */
|
|
277
|
-
name: TName;
|
|
278
|
-
/** Optional label for the field */
|
|
279
|
-
label?: string;
|
|
280
|
-
/** Optional description text below the field */
|
|
281
|
-
description?: string;
|
|
282
|
-
/** Optional warning text to display */
|
|
283
|
-
warningText?: string;
|
|
284
|
-
/** Whether the field is required */
|
|
285
|
-
required?: boolean;
|
|
286
|
-
/** Whether the field is disabled */
|
|
287
|
-
disabled?: boolean;
|
|
288
|
-
/** Whether the field is read-only */
|
|
289
|
-
readOnly?: boolean;
|
|
290
|
-
/** Optional aria-label for accessibility */
|
|
291
|
-
"aria-label"?: string;
|
|
292
|
-
/** Optional aria-describedby for accessibility */
|
|
293
|
-
"aria-describedby"?: string;
|
|
294
|
-
/** Radio button group options */
|
|
295
|
-
options: RHFRadioButtonGroupOption[];
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* A radio button group component that integrates with React Hook Form.
|
|
300
|
-
* Uses buttons instead of traditional radio inputs for a more modern look.
|
|
301
|
-
*
|
|
302
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfradiobuttongroup--docs
|
|
303
|
-
*
|
|
304
|
-
* @example
|
|
305
|
-
* ```tsx
|
|
306
|
-
* <Form>
|
|
307
|
-
* <RHFRadioButtonGroup
|
|
308
|
-
* name="preference"
|
|
309
|
-
* label="Select your preference"
|
|
310
|
-
* options={[
|
|
311
|
-
* { value: "option1", label: "Option 1" },
|
|
312
|
-
* { value: "option2", label: "Option 2" },
|
|
313
|
-
* { value: "option3", label: "Option 3" }
|
|
314
|
-
* ]}
|
|
315
|
-
* />
|
|
316
|
-
* </Form>
|
|
317
|
-
* ```
|
|
318
|
-
*/
|
|
319
|
-
declare function RHFRadioButtonGroup<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ name, label, description, className, warningText, required, disabled, readOnly, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, options, ...other }: RHFRadioButtonGroupProps<TFieldValues, TName>): react_jsx_runtime.JSX.Element;
|
|
320
|
-
|
|
321
|
-
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
322
|
-
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
323
|
-
declare const useFormField: () => {
|
|
324
|
-
invalid: boolean;
|
|
325
|
-
isDirty: boolean;
|
|
326
|
-
isTouched: boolean;
|
|
327
|
-
isValidating: boolean;
|
|
328
|
-
error?: react_hook_form.FieldError;
|
|
329
|
-
id: string;
|
|
330
|
-
name: string;
|
|
331
|
-
formItemId: string;
|
|
332
|
-
formDescriptionId: string;
|
|
333
|
-
formMessageId: string;
|
|
334
|
-
};
|
|
335
|
-
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
336
|
-
declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
337
|
-
declare const FormControl: React.ForwardRefExoticComponent<Omit<_radix_ui_react_slot.SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
338
|
-
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
339
|
-
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* Props interface for the Form component.
|
|
343
|
-
* Extends react-hook-form's FormProvider props.
|
|
344
|
-
*/
|
|
345
|
-
interface FormProps<TFieldValues extends FieldValues = FieldValues> {
|
|
346
|
-
/**
|
|
347
|
-
* The form context value
|
|
348
|
-
*/
|
|
349
|
-
context: React.Context<TFieldValues>;
|
|
350
|
-
/**
|
|
351
|
-
* The form children
|
|
352
|
-
*/
|
|
353
|
-
children: React.ReactNode;
|
|
354
|
-
}
|
|
355
|
-
/**
|
|
356
|
-
* Props interface for the FormField component.
|
|
357
|
-
* Extends react-hook-form's Controller props.
|
|
358
|
-
*/
|
|
359
|
-
interface FormFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends ControllerProps<TFieldValues, TName> {
|
|
360
|
-
}
|
|
361
|
-
/**
|
|
362
|
-
* Props interface for the FormItem component.
|
|
363
|
-
* Extends HTML div attributes.
|
|
364
|
-
*/
|
|
365
|
-
interface FormItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* Props interface for the FormLabel component.
|
|
369
|
-
* Extends Radix UI Label props.
|
|
370
|
-
*/
|
|
371
|
-
interface FormLabelProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> {
|
|
372
|
-
}
|
|
373
|
-
/**
|
|
374
|
-
* Props interface for the FormControl component.
|
|
375
|
-
* Extends Radix UI Slot props.
|
|
376
|
-
*/
|
|
377
|
-
interface FormControlProps extends React.ComponentPropsWithoutRef<typeof Slot> {
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* Props interface for the FormDescription component.
|
|
381
|
-
* Extends HTML paragraph attributes.
|
|
382
|
-
*/
|
|
383
|
-
interface FormDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
384
|
-
}
|
|
385
|
-
/**
|
|
386
|
-
* Props interface for the FormMessage component.
|
|
387
|
-
* Extends HTML paragraph attributes.
|
|
388
|
-
*/
|
|
389
|
-
interface FormMessageProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
390
|
-
/**
|
|
391
|
-
* The message content
|
|
392
|
-
*/
|
|
393
|
-
children?: React.ReactNode;
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* Context value type for form field context
|
|
397
|
-
*/
|
|
398
|
-
type FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
|
|
399
|
-
name: TName;
|
|
400
|
-
};
|
|
401
|
-
/**
|
|
402
|
-
* Context value type for form item context
|
|
403
|
-
*/
|
|
404
|
-
type FormItemContextValue = {
|
|
405
|
-
id: string;
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
export { Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, type FormFieldContextValue, type FormFieldProps, FormItem, type FormItemContextValue, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, type FormProps, RHFCheckbox, RHFRadioButtonGroup, type RHFRadioButtonGroupOption, type RHFRadioButtonGroupProps, RHFRadioGroup, RHFSwitch, RHFTextField, RHFTextarea, useFormField };
|
package/dist/rhf.esm.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1,g,b,c as c$2,e,d,f as f$1}from'./chunk-MOYOCJW6.esm.js';import {c as c$1,b as b$1}from'./chunk-JUZG25DH.esm.js';import {a}from'./chunk-C26U3FL4.esm.js';import {useFormContext,FormProvider,Controller}from'react-hook-form';import*as F from'react';import {Slot}from'@radix-ui/react-slot';import {jsx,jsxs}from'react/jsx-runtime';var oe=FormProvider,U=F.createContext({}),R=({...r})=>jsx(U.Provider,{value:{name:r.name},children:jsx(Controller,{...r})}),k=()=>{let r=F.useContext(U),a=F.useContext(X),{getFieldState:t,formState:i}=useFormContext(),o=t(r.name,i);if(!r)throw new Error("useFormField should be used within <FormField>");let{id:e}=a;return {id:e,name:r.name,formItemId:`${e}-form-item`,formDescriptionId:`${e}-form-item-description`,formMessageId:`${e}-form-item-message`,...o}},X=F.createContext({}),p=F.forwardRef(({className:r,...a$1},t)=>{let i=F.useId();return jsx(X.Provider,{value:{id:i},children:jsx("div",{ref:t,className:a("space-y-2",r),...a$1})})});p.displayName="FormItem";var u=F.forwardRef(({className:r,...a$2},t)=>{let{error:i,formItemId:o}=k();return jsx(a$1,{ref:t,className:a(i&&"text-destructive",r),htmlFor:o,...a$2})});u.displayName="FormLabel";var c=F.forwardRef(({...r},a)=>{let{error:t,formItemId:i,formDescriptionId:o,formMessageId:e}=k();return jsx(Slot,{ref:a,id:i,"aria-describedby":t?`${o} ${e}`:`${o}`,"aria-invalid":!!t,...r})});c.displayName="FormControl";var n=F.forwardRef(({className:r,...a$1},t)=>{let{formDescriptionId:i}=k();return jsx("p",{ref:t,id:i,className:a("text-sm text-muted-foreground",r),...a$1})});n.displayName="FormDescription";var f=F.forwardRef(({className:r,children:a$1,...t},i)=>{let{error:o,formMessageId:e}=k(),m=o?String(o?.message??""):a$1;return m?jsx("p",{ref:i,id:e,className:a("text-sm font-medium text-destructive",r),...t,children:m}):null});f.displayName="FormMessage";function Ce({name:r,label:a$1,description:t,className:i,type:o="text",warningText:e,required:m,disabled:I,readOnly:y,placeholder:h,"aria-label":T,"aria-describedby":x,onBlur:b,...s}){let{control:C}=useFormContext();return jsx(R,{name:r,control:C,render:({field:l,fieldState:{error:d}})=>jsxs(p,{children:[a$1&&jsxs(u,{children:[a$1,m&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsx(c,{children:jsx(c$1,{...l,type:o,value:o==="number"&&l.value===0?"":l.value,onChange:g=>{o==="number"?l.onChange(Number(g.target.value)):l.onChange(g.target.value);},onBlur:g=>{o!=="number"&&typeof l.value=="string"&&l.onChange(l.value.trim()),l.onBlur(),b?.(g);},className:a(d&&"border-destructive focus-visible:ring-destructive",i),disabled:I,readOnly:y,required:m,placeholder:h,"aria-label":T,"aria-describedby":x,"aria-invalid":!!d,"aria-required":m,...s})}),t&&jsx(n,{children:t}),d&&jsx(f,{children:d.message}),!d&&e&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:e})]})})}var E=F.forwardRef(({className:r,autoResize:a$1=false,...t},i)=>{let o=F.useRef(null);return F.useEffect(()=>{if(!a$1||!o.current)return;let e=o.current,m=()=>{e.style.height="auto",e.style.height=`${e.scrollHeight}px`;};return e.addEventListener("input",m),m(),()=>e.removeEventListener("input",m)},[a$1]),jsx("textarea",{className:a("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:i,...t})});E.displayName="Textarea";function De({name:r,label:a$1,description:t,className:i,warningText:o,required:e,disabled:m,readOnly:I,placeholder:y,autoResize:h,"aria-label":T,"aria-describedby":x,onBlur:b,...s}){let{control:C}=useFormContext();return jsx(R,{name:r,control:C,render:({field:l,fieldState:{error:d}})=>jsxs(p,{children:[a$1&&jsxs(u,{children:[a$1,e&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsx(c,{children:jsx(E,{...l,value:l.value,onChange:g=>{l.onChange(g.target.value);},onBlur:g=>{typeof l.value=="string"&&l.onChange(l.value.trim()),l.onBlur(),b?.(g);},className:a(d&&"border-destructive focus-visible:ring-destructive",i),disabled:m,readOnly:I,required:e,placeholder:y,"aria-label":T,"aria-describedby":x,"aria-invalid":!!d,"aria-required":e,autoResize:h,...s})}),t&&jsx(n,{children:t}),d&&jsx(f,{children:d.message}),!d&&o&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:o})]})})}function Be({name:r,label:a,description:t,className:i,warningText:o,required:e,disabled:m,readOnly:I,"aria-label":y,"aria-describedby":h,...T}){let{control:x}=useFormContext();return jsx(R,{name:r,control:x,render:({field:b,fieldState:{error:s}})=>jsxs(p,{className:"flex flex-row items-start space-x-3 space-y-0",children:[jsx(c,{children:jsx(g,{checked:b.value,onCheckedChange:b.onChange,disabled:m,"aria-label":y,"aria-describedby":h,"aria-invalid":!!s,"aria-required":e,...T})}),jsxs("div",{className:"space-y-1 leading-none",children:[a&&jsxs(u,{children:[a,e&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),t&&jsx(n,{children:t}),s&&jsx(f,{children:s.message}),!s&&o&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:o})]})]})})}function Je({name:r,label:a,description:t,className:i,warningText:o,required:e,disabled:m,readOnly:I,"aria-label":y,"aria-describedby":h,...T}){let{control:x}=useFormContext();return jsx(R,{name:r,control:x,render:({field:b$1,fieldState:{error:s}})=>jsxs(p,{className:"flex flex-row items-start space-x-3 space-y-0",children:[jsx(c,{children:jsx(b,{checked:b$1.value,onCheckedChange:b$1.onChange,disabled:m,"aria-label":y,"aria-describedby":h,"aria-invalid":!!s,"aria-required":e,...T})}),jsxs("div",{className:"space-y-1 leading-none",children:[a&&jsxs(u,{children:[a,e&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),t&&jsx(n,{children:t}),s&&jsx(f,{children:s.message}),!s&&o&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:o})]})]})})}function Ze({name:r,label:a,description:t,className:i,warningText:o,required:e$1,disabled:m,readOnly:I,"aria-label":y,"aria-describedby":h,children:T,...x}){let{control:b}=useFormContext(),s="options"in x;return jsx(R,{name:r,control:b,render:({field:C,fieldState:{error:l}})=>jsxs(p,{className:"space-y-3",children:[a&&jsxs(u,{children:[a,e$1&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsx(c,{children:jsxs(c$2,{onValueChange:C.onChange,defaultValue:C.value,disabled:m,"aria-label":y,"aria-describedby":h,"aria-invalid":!!l,"aria-required":e$1,...x,children:[s&&x.options.map(d$1=>jsxs(e,{children:[jsx(d,{value:d$1.id,id:d$1.id}),jsx(f$1,{htmlFor:d$1.id,children:d$1.label})]},d$1.id)),!s&&T]})}),t&&jsx(n,{children:t}),l&&jsx(f,{children:l.message}),!l&&o&&jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-500",role:"alert",children:o})]})})}function ra({name:r,label:a,description:t,className:i,warningText:o,required:e,disabled:m,readOnly:I,"aria-label":y,"aria-describedby":h,options:T,...x}){let{control:b}=useFormContext();return jsx(R,{name:r,control:b,render:({field:s,fieldState:{error:C}})=>jsxs(p,{className:"space-y-3",children:[a&&jsxs(u,{children:[a,e&&jsx("span",{className:"text-destructive ml-1",children:"*"})]}),jsx(c,{children:jsx(c$2,{onValueChange:s.onChange,defaultValue:s.value,disabled:m,"aria-label":y,"aria-describedby":h,"aria-invalid":!!C,"aria-required":e,className:"flex gap-2 p-2 border border-gray-200 rounded-md w-fit",...x,children:T.map(l=>jsx(b$1,{size:l.size??"sm",variant:s.value===l.id?"default":"secondary",onClick:()=>s.onChange(l.id),role:"radio","aria-checked":s.value===l.id,disabled:m,children:l.label},l.id))})}),t&&jsx(n,{children:t}),o&&jsx(n,{className:"text-warning",children:o}),C&&jsx(f,{children:C.message})]})})}export{oe as Form,c as FormControl,n as FormDescription,R as FormField,p as FormItem,u as FormLabel,f as FormMessage,Be as RHFCheckbox,ra as RHFRadioButtonGroup,Ze as RHFRadioGroup,Je as RHFSwitch,Ce as RHFTextField,De as RHFTextarea,k as useFormField};//# sourceMappingURL=rhf.esm.js.map
|
|
2
|
-
//# sourceMappingURL=rhf.esm.js.map
|
package/dist/rhf.esm.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/rhf/form/form.tsx","../src/components/rhf/rhf-text-field/rhf-text-field.tsx","../src/components/atoms/textarea/textarea.tsx","../src/components/rhf/rhf-textarea/rhf-textarea.tsx","../src/components/rhf/rhf-checkbox/rhf-checkbox.tsx","../src/components/rhf/rhf-switch/rhf-switch.tsx","../src/components/rhf/rhf-radio-group/rhf-radio-group.tsx","../src/components/rhf/rhf-radio-button-group/rhf-radio-button-group.tsx"],"names":["Form","FormProvider","FormFieldContext","FormField","props","jsx","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body","RHFTextField","name","label","description","type","warningText","required","disabled","readOnly","placeholder","ariaLabel","ariaDescribedby","onBlur","other","control","field","jsxs","Input","e","Textarea","D","autoResize","internalRef","textarea","resizeTextarea","RHFTextarea","RHFCheckbox","Checkbox","RHFSwitch","Switch","RHFRadioGroup","hasOptions","RadioGroup","option","RadioItemContainer","RadioGroupItem","RadioItemLabel","RHFRadioButtonGroup","options","Button"],"mappings":"2VAiBMA,EAAOC,CAAAA,YAAAA,CASPC,EAAyB,CAA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AAA,CAAAA,CAAM,MACpB,QAAUR,CAAAA,CAAAA,CACV,aAAYG,CACZ,CAAA,kBAAA,CAAkBC,EAClB,cAAc,CAAA,CAAC,CAACtB,CAChB,CAAA,eAAA,CAAeiB,EACf,SAAU,CAAA,wDAAA,CACT,GAAGO,CAEH,CAAA,QAAA,CAAAyB,EAAQ,GAAKL,CAAAA,CAAAA,EACZ5D,IAACkE,GAAA,CAAA,CAEC,KAAMN,CAAO,CAAA,IAAA,EAAQ,KACrB,OAASlB,CAAAA,CAAAA,CAAM,QAAUkB,CAAO,CAAA,EAAA,CAAK,UAAY,WACjD,CAAA,OAAA,CAAS,IAAMlB,CAAM,CAAA,QAAA,CAASkB,EAAO,EAAE,CAAA,CACvC,KAAK,OACL,CAAA,cAAA,CAAclB,EAAM,KAAUkB,GAAAA,CAAAA,CAAO,GACrC,QAAU1B,CAAAA,CAAAA,CAET,SAAA0B,CAAO,CAAA,KAAA,CAAA,CARHA,EAAO,EASd,CACD,EACH,CACF,CAAA,CAAA,CACC9B,GAAe9B,GAACuB,CAAAA,CAAAA,CAAA,CAAiB,QAAAO,CAAAA,CAAAA,CAAY,EAC7CE,CAAehC,EAAAA,GAAAA,CAACuB,EAAA,CAAgB,SAAA,CAAU,eAAgB,QAAAS,CAAAA,CAAAA,CAAY,EACtEhB,CAAShB,EAAAA,GAAAA,CAACwB,EAAA,CAAa,QAAA,CAAAR,EAAM,OAAQ,CAAA,CAAA,CAAA,CACxC,EAEJ,CAEJ","file":"rhf.esm.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n Controller,\n FormProvider,\n useFormContext,\n type ControllerProps,\n type FieldPath,\n type FieldValues\n} from \"react-hook-form\"\n\nimport { cn } from \"@/utils/cn\"\nimport { Label } from \"@/components/atoms/label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const { getFieldState, formState } = useFormContext()\n\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const { id } = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue)\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n )\n }\n)\nFormItem.displayName = \"FormItem\"\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n})\nFormLabel.displayName = \"FormLabel\"\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n )\n})\nFormControl.displayName = \"FormControl\"\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n})\nFormDescription.displayName = \"FormDescription\"\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message ?? \"\") : children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n )\n})\nFormMessage.displayName = \"FormMessage\"\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField\n}\n","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { Input } from \"@/components/atoms/input\"\nimport { cn } from \"@/utils/cn\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport { type RHFTextFieldProps } from \"./rhf-text-field.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A text field component that integrates with React Hook Form.\n * Provides form validation, error handling, and accessibility features.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextfield--docs\n *\n * * @example\n * ```tsx\n * <Form>\n * <RHFTextField name=\"name\" label=\"Name\" />\n * <RHFTextField name=\"email\" label=\"Email\" />\n * </Form>\n * ```\n */\nexport function RHFTextField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n label,\n description,\n className,\n type = \"text\",\n warningText,\n required,\n disabled,\n readOnly,\n placeholder,\n \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n onBlur,\n ...other\n}: RHFTextFieldProps<TFieldValues, TName>) {\n const { control } = useFormContext<TFieldValues>()\n\n return (\n <FormField\n name={name}\n control={control}\n render={({ field, fieldState: { error } }) => (\n <FormItem>\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n <FormControl>\n <Input\n {...field}\n type={type}\n value={type === \"number\" && field.value === 0 ? \"\" : field.value}\n onChange={(e) => {\n if (type === \"number\") {\n field.onChange(Number(e.target.value))\n } else {\n field.onChange(e.target.value)\n }\n }}\n onBlur={(e) => {\n // trim if a string\n if (type !== \"number\" && typeof field.value === \"string\") {\n field.onChange(field.value.trim())\n }\n field.onBlur() // pass to react-hook-form\n onBlur?.(e) // pass to wrapper\n }}\n className={cn(\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n placeholder={placeholder}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n {...other}\n />\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n {!error && warningText && (\n <p className=\"text-sm text-yellow-600 dark:text-yellow-500\" role=\"alert\">\n {warningText}\n </p>\n )}\n </FormItem>\n )}\n />\n )\n}\n","import * as React from \"react\"\nimport { cn } from \"@/utils/index\"\nimport { TextareaProps } from \"./textarea.types\"\n\n/**\n * Textarea component for creating accessible text areas.\n * Built on top of shadcn/ui's Textarea component.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-textarea--docs\n *\n * @example\n * ```tsx\n * <Textarea placeholder=\"Enter text\" />\n * ```\n */\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, autoResize = false, ...props }, ref) => {\n const internalRef = React.useRef<HTMLTextAreaElement>(null)\n\n React.useEffect(() => {\n if (!autoResize || !internalRef.current) return\n\n const textarea = internalRef.current\n const resizeTextarea = () => {\n textarea.style.height = \"auto\"\n textarea.style.height = `${textarea.scrollHeight}px`\n }\n\n textarea.addEventListener(\"input\", resizeTextarea)\n resizeTextarea() // Initial resize\n\n return () => textarea.removeEventListener(\"input\", resizeTextarea)\n }, [autoResize])\n\n return (\n <textarea\n className={cn(\n \"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\n\nTextarea.displayName = \"Textarea\"\n\nexport { Textarea }\n","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { Textarea } from \"@/components/atoms/textarea\"\nimport { cn } from \"@/utils/cn\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport { type RHFTextareaProps } from \"./rhf-textarea.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A textarea component that integrates with React Hook Form.\n * Provides form validation, error handling, and accessibility features.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhftextarea--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFTextarea name=\"description\" label=\"Description\" />\n * </Form>\n * ```\n */\nexport function RHFTextarea<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n label,\n description,\n className,\n warningText,\n required,\n disabled,\n readOnly,\n placeholder,\n autoResize,\n \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n onBlur,\n ...other\n}: RHFTextareaProps<TFieldValues, TName>) {\n const { control } = useFormContext<TFieldValues>()\n\n return (\n <FormField\n name={name}\n control={control}\n render={({ field, fieldState: { error } }) => (\n <FormItem>\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n <FormControl>\n <Textarea\n {...field}\n value={field.value}\n onChange={(e) => {\n field.onChange(e.target.value)\n }}\n onBlur={(e) => {\n // trim if a string\n if (typeof field.value === \"string\") {\n field.onChange(field.value.trim())\n }\n field.onBlur() // pass to react-hook-form\n onBlur?.(e) // pass to wrapper\n }}\n className={cn(\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n placeholder={placeholder}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n autoResize={autoResize}\n {...other}\n />\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n {!error && warningText && (\n <p className=\"text-sm text-yellow-600 dark:text-yellow-500\" role=\"alert\">\n {warningText}\n </p>\n )}\n </FormItem>\n )}\n />\n )\n}\n","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { Checkbox } from \"@/components/atoms/checkbox\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport { type RHFCheckboxProps } from \"./rhf-checkbox.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A checkbox component that integrates with React Hook Form.\n * Provides form validation, error handling, and accessibility features.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfcheckbox--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFCheckbox name=\"terms\" label=\"Accept terms and conditions\" />\n * </Form>\n * ```\n */\nexport function RHFCheckbox<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n label,\n description,\n className,\n warningText,\n required,\n disabled,\n readOnly,\n \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n ...other\n}: RHFCheckboxProps<TFieldValues, TName>) {\n const { control } = useFormContext<TFieldValues>()\n\n return (\n <FormField\n name={name}\n control={control}\n render={({ field, fieldState: { error } }) => (\n <FormItem className=\"flex flex-row items-start space-x-3 space-y-0\">\n <FormControl>\n <Checkbox\n checked={field.value}\n onCheckedChange={field.onChange}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n {...other}\n />\n </FormControl>\n <div className=\"space-y-1 leading-none\">\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n {description && <FormDescription>{description}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n {!error && warningText && (\n <p className=\"text-sm text-yellow-600 dark:text-yellow-500\" role=\"alert\">\n {warningText}\n </p>\n )}\n </div>\n </FormItem>\n )}\n />\n )\n}\n","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { Switch } from \"@/components/atoms/switch\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport { type RHFSwitchProps } from \"./rhf-switch.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A switch component that integrates with React Hook Form.\n * Provides form validation, error handling, and accessibility features.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfswitch--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFSwitch name=\"notifications\" label=\"Enable notifications\" />\n * </Form>\n * ```\n */\nexport function RHFSwitch<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n label,\n description,\n className,\n warningText,\n required,\n disabled,\n readOnly,\n \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n ...other\n}: RHFSwitchProps<TFieldValues, TName>) {\n const { control } = useFormContext<TFieldValues>()\n\n return (\n <FormField\n name={name}\n control={control}\n render={({ field, fieldState: { error } }) => (\n <FormItem className=\"flex flex-row items-start space-x-3 space-y-0\">\n <FormControl>\n <Switch\n checked={field.value}\n onCheckedChange={field.onChange}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n {...other}\n />\n </FormControl>\n <div className=\"space-y-1 leading-none\">\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n {description && <FormDescription>{description}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n {!error && warningText && (\n <p className=\"text-sm text-yellow-600 dark:text-yellow-500\" role=\"alert\">\n {warningText}\n </p>\n )}\n </div>\n </FormItem>\n )}\n />\n )\n}\n","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport {\n RadioGroup,\n RadioGroupItem,\n RadioItemLabel,\n RadioItemContainer\n} from \"@/components/atoms/radio-group\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport {\n RHFRadioGroupOption,\n type RHFRadioGroupProps,\n type RHFRadioGroupWithOptionsProps\n} from \"./rhf-radio-group.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A radio group component that integrates with React Hook Form.\n * Provides form validation, error handling, and accessibility features.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfradiogroup--docs\n *\n * @example\n * ```tsx\n * // Using children\n * <Form>\n * <RHFRadioGroup name=\"preference\" label=\"Select your preference\">\n * <RadioGroupItem value=\"option1\" label=\"Option 1\" />\n * <RadioGroupItem value=\"option2\" label=\"Option 2\" />\n * </RHFRadioGroup>\n * </Form>\n *\n * // Using options prop\n * <Form>\n * <RHFRadioGroup\n * name=\"preference\"\n * label=\"Select your preference\"\n * options={[\n * { id: \"option1\", label: \"Option 1\" },\n * { id: \"option2\", label: \"Option 2\" }\n * ]}\n * />\n * </Form>\n * ```\n */\nexport function RHFRadioGroup<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n label,\n description,\n className,\n warningText,\n required,\n disabled,\n readOnly,\n \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n children,\n ...other\n}: RHFRadioGroupProps<TFieldValues, TName>) {\n const { control } = useFormContext<TFieldValues>()\n const hasOptions = \"options\" in other\n\n return (\n <FormField\n name={name}\n control={control}\n render={({ field, fieldState: { error } }) => (\n <FormItem className=\"space-y-3\">\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n <FormControl>\n <RadioGroup\n onValueChange={field.onChange}\n defaultValue={field.value}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n {...other}\n >\n {hasOptions &&\n (other as RHFRadioGroupWithOptionsProps<TFieldValues, TName>).options.map(\n (option: RHFRadioGroupOption) => (\n <RadioItemContainer key={option.id}>\n <RadioGroupItem value={option.id} id={option.id} />\n <RadioItemLabel htmlFor={option.id}>{option.label}</RadioItemLabel>\n </RadioItemContainer>\n )\n )}\n {!hasOptions && children}\n </RadioGroup>\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n {!error && warningText && (\n <p className=\"text-sm text-yellow-600 dark:text-yellow-500\" role=\"alert\">\n {warningText}\n </p>\n )}\n </FormItem>\n )}\n />\n )\n}\n","import * as React from \"react\"\nimport { useFormContext, type FieldValues, type FieldPath } from \"react-hook-form\"\nimport { RadioGroup } from \"@/components/atoms/radio-group\"\nimport { Button } from \"@/components/atoms/button\"\nimport {\n FormControl,\n FormItem,\n FormMessage,\n FormLabel,\n FormDescription,\n FormField\n} from \"@/components/rhf/form\"\nimport { type RHFRadioButtonGroupProps } from \"./rhf-radio-button-group.types\"\n\n// ----------------------------------------------------------------------\n\n/**\n * A radio button group component that integrates with React Hook Form.\n * Uses buttons instead of traditional radio inputs for a more modern look.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-rhf-rhfradiobuttongroup--docs\n *\n * @example\n * ```tsx\n * <Form>\n * <RHFRadioButtonGroup\n * name=\"preference\"\n * label=\"Select your preference\"\n * options={[\n * { value: \"option1\", label: \"Option 1\" },\n * { value: \"option2\", label: \"Option 2\" },\n * { value: \"option3\", label: \"Option 3\" }\n * ]}\n * />\n * </Form>\n * ```\n */\nexport function RHFRadioButtonGroup<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>\n>({\n name,\n label,\n description,\n className,\n warningText,\n required,\n disabled,\n readOnly,\n \"aria-label\": ariaLabel,\n \"aria-describedby\": ariaDescribedby,\n options,\n ...other\n}: RHFRadioButtonGroupProps<TFieldValues, TName>) {\n const { control } = useFormContext<TFieldValues>()\n\n return (\n <FormField\n name={name}\n control={control}\n render={({ field, fieldState: { error } }) => (\n <FormItem className=\"space-y-3\">\n {label && (\n <FormLabel>\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </FormLabel>\n )}\n <FormControl>\n <RadioGroup\n onValueChange={field.onChange}\n defaultValue={field.value}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-invalid={!!error}\n aria-required={required}\n className=\"flex gap-2 p-2 border border-gray-200 rounded-md w-fit\"\n {...other}\n >\n {options.map((option) => (\n <Button\n key={option.id}\n size={option.size ?? \"sm\"}\n variant={field.value === option.id ? \"default\" : \"secondary\"}\n onClick={() => field.onChange(option.id)}\n role=\"radio\"\n aria-checked={field.value === option.id}\n disabled={disabled}\n >\n {option.label}\n </Button>\n ))}\n </RadioGroup>\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {warningText && <FormDescription className=\"text-warning\">{warningText}</FormDescription>}\n {error && <FormMessage>{error.message}</FormMessage>}\n </FormItem>\n )}\n />\n )\n}\n"]}
|
package/dist/toast-2xT7L1tJ.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import * as ToastPrimitives from '@radix-ui/react-toast';
|
|
4
|
-
import { VariantProps } from 'class-variance-authority';
|
|
5
|
-
|
|
6
|
-
declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
|
|
7
|
-
declare const ToastViewport: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React.RefAttributes<HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
|
|
8
|
-
declare const Toast: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
|
|
9
|
-
variant?: "default" | "destructive" | null | undefined;
|
|
10
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLLIElement>>;
|
|
11
|
-
declare const ToastAction: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
-
declare const ToastClose: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
13
|
-
declare const ToastTitle: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
-
declare const ToastDescription: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastDescriptionProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
-
type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
|
|
16
|
-
type ToastActionElement = React.ReactElement<typeof ToastAction>;
|
|
17
|
-
|
|
18
|
-
export { type ToastProps as T, type ToastActionElement as a, ToastProvider as b, ToastViewport as c, Toast as d, ToastTitle as e, ToastDescription as f, ToastClose as g, ToastAction as h };
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { VariantProps } from 'class-variance-authority';
|
|
4
|
-
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Props interface for the Button component.
|
|
8
|
-
* Extends the native button HTML attributes and adds support for variants and asChild prop.
|
|
9
|
-
* Implements proper accessibility features and follows WCAG 2.1 Level AA guidelines.
|
|
10
|
-
*
|
|
11
|
-
* @interface ButtonProps
|
|
12
|
-
* @extends {React.ButtonHTMLAttributes<HTMLButtonElement>}
|
|
13
|
-
* @extends {VariantProps<typeof buttonVariants>}
|
|
14
|
-
*
|
|
15
|
-
* @property {boolean} [asChild] - When true, renders the button as a child component using Radix UI's Slot.
|
|
16
|
-
* @property {ButtonVariant} [variant] - The visual style variant of the button.
|
|
17
|
-
* @property {ButtonSize} [size] - The size variant of the button.
|
|
18
|
-
* @property {string} [className] - Additional CSS classes to apply to the button.
|
|
19
|
-
* @property {React.ReactNode} [startIcon] - Icon to display before the button text.
|
|
20
|
-
* @property {React.ReactNode} [endIcon] - Icon to display after the button text.
|
|
21
|
-
* @property {boolean} [loading] - Whether the button is in a loading state.
|
|
22
|
-
* @property {string} [type] - The type of button (button, submit, reset). Defaults to "button".
|
|
23
|
-
* @property {string} [aria-label] - Accessible label for the button. Falls back to button text if not provided.
|
|
24
|
-
*/
|
|
25
|
-
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
26
|
-
asChild?: boolean;
|
|
27
|
-
startIcon?: React.ReactNode;
|
|
28
|
-
endIcon?: React.ReactNode;
|
|
29
|
-
loading?: boolean;
|
|
30
|
-
type?: "button" | "submit" | "reset";
|
|
31
|
-
"aria-label"?: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Button variant styles using class-variance-authority.
|
|
36
|
-
* Defines the visual styles for different button variants and sizes.
|
|
37
|
-
* Follows WCAG 2.1 Level AA guidelines for accessibility.
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```tsx
|
|
41
|
-
* <Button variant="primary" size="lg">Click me</Button>
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
declare const buttonVariants: (props?: ({
|
|
45
|
-
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
46
|
-
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
47
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
48
|
-
/**
|
|
49
|
-
* A versatile button component that supports multiple variants, sizes, and can be rendered as a child component.
|
|
50
|
-
* Built on top of Radix UI's Slot primitive for maximum flexibility.
|
|
51
|
-
* Implements proper accessibility features and follows WCAG 2.1 Level AA guidelines.
|
|
52
|
-
*
|
|
53
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-button--docs
|
|
54
|
-
*
|
|
55
|
-
* @component
|
|
56
|
-
* @example
|
|
57
|
-
* ```tsx
|
|
58
|
-
* // Default button
|
|
59
|
-
* <Button>Click me</Button>
|
|
60
|
-
*
|
|
61
|
-
* // Destructive button with small size
|
|
62
|
-
* <Button variant="destructive" size="sm">Delete</Button>
|
|
63
|
-
*
|
|
64
|
-
* // As a link
|
|
65
|
-
* <Button variant="link" asChild>
|
|
66
|
-
* <a href="/about">About</a>
|
|
67
|
-
* </Button>
|
|
68
|
-
*
|
|
69
|
-
* // With icons
|
|
70
|
-
* <Button startIcon={<Icon />}>With Start Icon</Button>
|
|
71
|
-
* <Button endIcon={<Icon />}>With End Icon</Button>
|
|
72
|
-
*
|
|
73
|
-
* // Loading state
|
|
74
|
-
* <Button loading>Loading</Button>
|
|
75
|
-
* ```
|
|
76
|
-
*
|
|
77
|
-
* @param {ButtonProps} props - The component props
|
|
78
|
-
* @param {React.Ref<HTMLButtonElement>} ref - Forwarded ref
|
|
79
|
-
* @returns {JSX.Element} A button element
|
|
80
|
-
*/
|
|
81
|
-
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* TooltipProvider component for creating accessible tooltips.
|
|
85
|
-
* Built on top of Radix UI's Tooltip primitive.
|
|
86
|
-
*
|
|
87
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-tooltip--docs
|
|
88
|
-
*
|
|
89
|
-
* @example
|
|
90
|
-
* ```tsx
|
|
91
|
-
* <TooltipProvider>
|
|
92
|
-
* <Tooltip>
|
|
93
|
-
* <TooltipTrigger>Hover me</TooltipTrigger>
|
|
94
|
-
* <TooltipContent>Tooltip content</TooltipContent>
|
|
95
|
-
* </Tooltip>
|
|
96
|
-
* </TooltipProvider>
|
|
97
|
-
* ```
|
|
98
|
-
*/
|
|
99
|
-
declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
100
|
-
declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
|
|
101
|
-
declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
102
|
-
declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
103
|
-
|
|
104
|
-
export { Button as B, Tooltip as T, type ButtonProps as a, buttonVariants as b, TooltipTrigger as c, TooltipContent as d, TooltipProvider as e };
|