@vhyxui/react 0.1.2-alpha.2 → 0.1.3-alpha
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/SelectField-BYmKwRVU.cjs +1 -0
- package/dist/SelectField-DL7K4ZhA.js +49 -0
- package/dist/TextField-C3r-6jr6.cjs +1 -0
- package/dist/TextField-DtXQQJJk.js +31 -0
- package/dist/TextareaField-CpqPinvx.js +31 -0
- package/dist/TextareaField-D234Lyi_.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +103 -0
- package/dist/index.js +47 -41
- package/dist/selectfield.cjs +1 -0
- package/dist/selectfield.d.ts +82 -0
- package/dist/selectfield.js +4 -0
- package/dist/textareafield.cjs +1 -0
- package/dist/textareafield.d.ts +84 -0
- package/dist/textareafield.js +4 -0
- package/dist/textfield.cjs +1 -0
- package/dist/textfield.d.ts +82 -0
- package/dist/textfield.js +4 -0
- package/package.json +16 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-BRMkMA8J.cjs"),R=require("./Field-D6FSsUGj.cjs"),t=require("./Select-C9yB2B8M.cjs");function r({name:l,label:i,hint:n,error:c,required:x,optional:u,layout:d,options:j,placeholder:o,value:m,onValueChange:a,disabled:S,size:p}){return e.jsxRuntimeExports.jsx(R.Field,{name:l,label:i,hint:n,error:c,required:x,optional:u,layout:d,children:e.jsxRuntimeExports.jsxs(t.Select,{value:m,onValueChange:a,disabled:S,size:p,placeholder:o,children:[e.jsxRuntimeExports.jsx(t.Select.Trigger,{"aria-label":typeof i=="string"?i:void 0}),e.jsxRuntimeExports.jsx(t.Select.Content,{children:j.map(s=>e.jsxRuntimeExports.jsx(t.Select.Item,{value:s.value,children:s.label},s.value))})]})})}r.displayName="VhyxSelectField";exports.SelectField=r;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-CL69jGNW.js";
|
|
2
|
+
import { F as f } from "./Field-Bv07PL2M.js";
|
|
3
|
+
import { S as r } from "./Select-DjeJOdb7.js";
|
|
4
|
+
function h({
|
|
5
|
+
name: s,
|
|
6
|
+
label: i,
|
|
7
|
+
hint: t,
|
|
8
|
+
error: a,
|
|
9
|
+
required: n,
|
|
10
|
+
optional: m,
|
|
11
|
+
layout: o,
|
|
12
|
+
options: d,
|
|
13
|
+
placeholder: x,
|
|
14
|
+
value: c,
|
|
15
|
+
onValueChange: j,
|
|
16
|
+
disabled: p,
|
|
17
|
+
size: u
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ e.jsx(
|
|
20
|
+
f,
|
|
21
|
+
{
|
|
22
|
+
name: s,
|
|
23
|
+
label: i,
|
|
24
|
+
hint: t,
|
|
25
|
+
error: a,
|
|
26
|
+
required: n,
|
|
27
|
+
optional: m,
|
|
28
|
+
layout: o,
|
|
29
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
30
|
+
r,
|
|
31
|
+
{
|
|
32
|
+
value: c,
|
|
33
|
+
onValueChange: j,
|
|
34
|
+
disabled: p,
|
|
35
|
+
size: u,
|
|
36
|
+
placeholder: x,
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ e.jsx(r.Trigger, { "aria-label": typeof i == "string" ? i : void 0 }),
|
|
39
|
+
/* @__PURE__ */ e.jsx(r.Content, { children: d.map((l) => /* @__PURE__ */ e.jsx(r.Item, { value: l.value, children: l.label }, l.value)) })
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
h.displayName = "VhyxSelectField";
|
|
47
|
+
export {
|
|
48
|
+
h as S
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("./jsx-runtime-BRMkMA8J.cjs"),c=require("./Field-D6FSsUGj.cjs"),o=require("./Input-UQ2fQwE7.cjs");function s({name:e,label:r,hint:n,error:t,required:u,optional:x,layout:d,...l}){return i.jsxRuntimeExports.jsx(c.Field,{name:e,label:r,hint:n,error:t,required:u,optional:x,layout:d,children:i.jsxRuntimeExports.jsx(o.Input,{name:e,error:!!t,...l})})}s.displayName="VhyxTextField";exports.TextField=s;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { j as i } from "./jsx-runtime-CL69jGNW.js";
|
|
2
|
+
import { F as a } from "./Field-Bv07PL2M.js";
|
|
3
|
+
import { I as d } from "./Input-BS_t1bl-.js";
|
|
4
|
+
function l({
|
|
5
|
+
name: r,
|
|
6
|
+
label: e,
|
|
7
|
+
hint: o,
|
|
8
|
+
error: t,
|
|
9
|
+
required: s,
|
|
10
|
+
optional: x,
|
|
11
|
+
layout: m,
|
|
12
|
+
...p
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ i.jsx(
|
|
15
|
+
a,
|
|
16
|
+
{
|
|
17
|
+
name: r,
|
|
18
|
+
label: e,
|
|
19
|
+
hint: o,
|
|
20
|
+
error: t,
|
|
21
|
+
required: s,
|
|
22
|
+
optional: x,
|
|
23
|
+
layout: m,
|
|
24
|
+
children: /* @__PURE__ */ i.jsx(d, { name: r, error: !!t, ...p })
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
l.displayName = "VhyxTextField";
|
|
29
|
+
export {
|
|
30
|
+
l as T
|
|
31
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { j as a } from "./jsx-runtime-CL69jGNW.js";
|
|
2
|
+
import { F as p } from "./Field-Bv07PL2M.js";
|
|
3
|
+
import { T as d } from "./Textarea-CLrctxHU.js";
|
|
4
|
+
function l({
|
|
5
|
+
name: r,
|
|
6
|
+
label: t,
|
|
7
|
+
hint: i,
|
|
8
|
+
error: e,
|
|
9
|
+
required: o,
|
|
10
|
+
optional: s,
|
|
11
|
+
layout: x,
|
|
12
|
+
...m
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ a.jsx(
|
|
15
|
+
p,
|
|
16
|
+
{
|
|
17
|
+
name: r,
|
|
18
|
+
label: t,
|
|
19
|
+
hint: i,
|
|
20
|
+
error: e,
|
|
21
|
+
required: o,
|
|
22
|
+
optional: s,
|
|
23
|
+
layout: x,
|
|
24
|
+
children: /* @__PURE__ */ a.jsx(d, { name: r, error: !!e, ...m })
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
l.displayName = "VhyxTextareaField";
|
|
29
|
+
export {
|
|
30
|
+
l as T
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("./jsx-runtime-BRMkMA8J.cjs"),l=require("./Field-D6FSsUGj.cjs"),c=require("./Textarea-H6evM8L4.cjs");function i({name:e,label:s,hint:x,error:r,required:a,optional:n,layout:u,...d}){return t.jsxRuntimeExports.jsx(l.Field,{name:e,label:s,hint:x,error:r,required:a,optional:n,layout:u,children:t.jsxRuntimeExports.jsx(c.Textarea,{name:e,error:!!r,...d})})}i.displayName="VhyxTextareaField";exports.TextareaField=i;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./VhyxUIProvider-C7ie8u2L.cjs"),u=require("./Button-AkUYT9eN.cjs"),l=require("./Input-UQ2fQwE7.cjs"),T=require("./Textarea-H6evM8L4.cjs"),q=require("./Select-C9yB2B8M.cjs"),g=require("./Checkbox-DvkT6QP9.cjs"),c=require("./RadioItem-BfkTHBxQ.cjs"),F=require("./Switch-BU_Tcttb.cjs"),s=require("./Field-D6FSsUGj.cjs"),m=require("./TextField-C3r-6jr6.cjs"),x=require("./SelectField-BYmKwRVU.cjs"),S=require("./TextareaField-D234Lyi_.cjs"),t=require("./Toast-ndaxbpcV.cjs"),P=require("./Alert-BJ1O0bnK.cjs"),f=require("./Badge-RM7n86Rq.cjs"),b=require("./Progress-FO-4WX0i.cjs"),v=require("./Spinner-BZGPmp9c.cjs"),I=require("./Dialog-gPT4noD8.cjs"),h=require("./Drawer-BygSIQQn.cjs"),w=require("./Tooltip-CCd6VRvZ.cjs"),B=require("./Popover-BPFkS4xn.cjs"),C=require("./Card-d5xrWgQS.cjs"),D=require("./Separator-C5lPGzes.cjs"),y=require("./Tabs-DuU02-UD.cjs"),A=require("./Breadcrumb-StitgXXx.cjs"),R=require("./Pagination-CmmcBPNz.cjs"),U=5e3;function o(i,r,e){const n={message:i,variant:r,duration:(e==null?void 0:e.duration)??U,dismissible:(e==null?void 0:e.dismissible)??!0};return(e==null?void 0:e.description)!==void 0&&(n.description=e.description),(e==null?void 0:e.action)!==void 0&&(n.action=e.action),n}function a(i,r){return t.addToast(o(i,"default",r))}a.success=function(r,e){return t.addToast(o(r,"success",e))};a.danger=function(r,e){return t.addToast(o(r,"danger",e))};a.warning=function(r,e){return t.addToast(o(r,"warning",e))};a.info=function(r,e){return t.addToast(o(r,"info",e))};a.dismiss=function(r){r!==void 0?t.dismissToast(r):t.dismissAllToasts()};const k=a;exports.VhyxUIProvider=d.VhyxUIProvider;exports.Button=u.Button;exports.Input=l.Input;exports.Textarea=T.Textarea;exports.Select=q.Select;exports.Checkbox=g.Checkbox;exports.RadioGroup=c.RadioGroup;exports.RadioItem=c.RadioItem;exports.Switch=F.Switch;exports.Field=s.Field;exports.Form=s.Form;exports.useFormContext=s.useFormContext;exports.TextField=m.TextField;exports.SelectField=x.SelectField;exports.TextareaField=S.TextareaField;exports.Toast=t.Toast;exports.ToastProvider=t.ToastProvider;exports.Alert=P.Alert;exports.Badge=f.Badge;exports.Progress=b.Progress;exports.Spinner=v.Spinner;exports.Dialog=I.Dialog;exports.Drawer=h.Drawer;exports.Tooltip=w.Tooltip;exports.Popover=B.Popover;exports.Card=C.Card;exports.Separator=D.Separator;exports.Tabs=y.Tabs;exports.Breadcrumb=A.Breadcrumb;exports.Pagination=R.Pagination;exports.toast=k;
|
package/dist/index.d.ts
CHANGED
|
@@ -496,6 +496,15 @@ export declare namespace Field {
|
|
|
496
496
|
var displayName: string;
|
|
497
497
|
}
|
|
498
498
|
|
|
499
|
+
/** Field-owned props — pulled from FieldProps without the HTML div base to avoid event-handler conflicts. */
|
|
500
|
+
declare type FieldOwnProps = Pick<FieldProps, 'name' | 'label' | 'hint' | 'error' | 'required' | 'optional' | 'layout'>;
|
|
501
|
+
|
|
502
|
+
/** Field-owned props — picked from FieldProps without the HTML div base. */
|
|
503
|
+
declare type FieldOwnProps_2 = Pick<FieldProps, 'name' | 'label' | 'hint' | 'error' | 'required' | 'optional' | 'layout'>;
|
|
504
|
+
|
|
505
|
+
/** Field-owned props — pulled from FieldProps without the HTML div base to avoid event-handler conflicts. */
|
|
506
|
+
declare type FieldOwnProps_3 = Pick<FieldProps, 'name' | 'label' | 'hint' | 'error' | 'required' | 'optional' | 'layout'>;
|
|
507
|
+
|
|
499
508
|
/** Props for the Field component — the label/input/hint/error assembly layer. */
|
|
500
509
|
export declare interface FieldProps extends Omit<default_2.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
501
510
|
/**
|
|
@@ -802,6 +811,55 @@ export declare interface SelectContentProps extends default_2.HTMLAttributes<HTM
|
|
|
802
811
|
children?: default_2.ReactNode;
|
|
803
812
|
}
|
|
804
813
|
|
|
814
|
+
/**
|
|
815
|
+
* SelectField — convenience compound of Field + Select.
|
|
816
|
+
*
|
|
817
|
+
* Renders a labelled dropdown with hint, error, and required indicator
|
|
818
|
+
* fully wired. Prefer this over manually composing Field + Select for
|
|
819
|
+
* single-selection dropdowns driven by a flat options array.
|
|
820
|
+
*
|
|
821
|
+
* @example
|
|
822
|
+
* <SelectField
|
|
823
|
+
* name="country"
|
|
824
|
+
* label="Country"
|
|
825
|
+
* value={value}
|
|
826
|
+
* onValueChange={setValue}
|
|
827
|
+
* options={[{ label: 'United States', value: 'us' }]}
|
|
828
|
+
* placeholder="Select a country"
|
|
829
|
+
* />
|
|
830
|
+
*/
|
|
831
|
+
export declare function SelectField({ name, label, hint, error, required, optional, layout, options, placeholder, value, onValueChange, disabled, size, }: SelectFieldProps): default_2.ReactElement;
|
|
832
|
+
|
|
833
|
+
export declare namespace SelectField {
|
|
834
|
+
var displayName: string;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
/** A single option rendered inside SelectField. */
|
|
838
|
+
export declare interface SelectFieldOption {
|
|
839
|
+
label: string;
|
|
840
|
+
value: string;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* Props for SelectField.
|
|
845
|
+
* `error` is a string (error message) from FieldProps.
|
|
846
|
+
* `placeholder` is passed to the root Select (not to Select.Trigger).
|
|
847
|
+
*/
|
|
848
|
+
export declare interface SelectFieldProps extends FieldOwnProps_2 {
|
|
849
|
+
/** The currently selected value (controlled). */
|
|
850
|
+
value: string;
|
|
851
|
+
/** Called when a new option is selected. */
|
|
852
|
+
onValueChange: (value: string) => void;
|
|
853
|
+
/** Options to render inside the dropdown. */
|
|
854
|
+
options: SelectFieldOption[];
|
|
855
|
+
/** Placeholder shown in the trigger when no value is selected. */
|
|
856
|
+
placeholder?: string;
|
|
857
|
+
/** When true, the trigger is disabled. */
|
|
858
|
+
disabled?: boolean;
|
|
859
|
+
/** Size applied to the Select and its sub-components. @default 'md' */
|
|
860
|
+
size?: 'sm' | 'md' | 'lg';
|
|
861
|
+
}
|
|
862
|
+
|
|
805
863
|
declare function SelectGroup({ children, className, ...rest }: SelectGroupProps): default_2.ReactElement;
|
|
806
864
|
|
|
807
865
|
declare namespace SelectGroup {
|
|
@@ -987,6 +1045,28 @@ export declare type TabsVariant = 'default' | 'pills' | 'underline' | 'enclosed'
|
|
|
987
1045
|
|
|
988
1046
|
export declare const Textarea: default_2.ForwardRefExoticComponent<default_2.PropsWithoutRef<TextareaProps> & default_2.RefAttributes<HTMLTextAreaElement>>;
|
|
989
1047
|
|
|
1048
|
+
/**
|
|
1049
|
+
* TextareaField — convenience compound of Field + Textarea.
|
|
1050
|
+
*
|
|
1051
|
+
* Renders a labelled multi-line textarea with hint, error, and required
|
|
1052
|
+
* indicator fully wired. Prefer this over manually composing Field + Textarea.
|
|
1053
|
+
*
|
|
1054
|
+
* @example
|
|
1055
|
+
* <TextareaField name="bio" label="Bio" minRows={4} placeholder="Tell us about yourself" />
|
|
1056
|
+
*/
|
|
1057
|
+
export declare function TextareaField({ name, label, hint, error, required, optional, layout, ...textareaProps }: TextareaFieldProps): default_2.ReactElement;
|
|
1058
|
+
|
|
1059
|
+
export declare namespace TextareaField {
|
|
1060
|
+
var displayName: string;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
/**
|
|
1064
|
+
* Combined props for TextareaField.
|
|
1065
|
+
* `error` is a string (error message) from FieldProps.
|
|
1066
|
+
* `id` is omitted — Field generates and manages it internally.
|
|
1067
|
+
*/
|
|
1068
|
+
export declare type TextareaFieldProps = FieldOwnProps_3 & Omit<TextareaProps, 'id' | 'error'>;
|
|
1069
|
+
|
|
990
1070
|
/** Props for the Textarea component. */
|
|
991
1071
|
export declare interface TextareaProps extends default_2.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
992
1072
|
/** Size of the textarea. @default 'md' */
|
|
@@ -1015,6 +1095,29 @@ export declare type TextareaResize = 'none' | 'vertical' | 'horizontal' | 'both'
|
|
|
1015
1095
|
/** Size tokens available on the Textarea component. */
|
|
1016
1096
|
export declare type TextareaSize = 'sm' | 'md' | 'lg';
|
|
1017
1097
|
|
|
1098
|
+
/**
|
|
1099
|
+
* TextField — convenience compound of Field + Input.
|
|
1100
|
+
*
|
|
1101
|
+
* Renders a labelled text input with hint, error, and required indicator
|
|
1102
|
+
* fully wired. Prefer this over manually composing Field + Input for
|
|
1103
|
+
* single-line text inputs.
|
|
1104
|
+
*
|
|
1105
|
+
* @example
|
|
1106
|
+
* <TextField name="email" label="Email" type="email" placeholder="you@example.com" required />
|
|
1107
|
+
*/
|
|
1108
|
+
export declare function TextField({ name, label, hint, error, required, optional, layout, ...inputProps }: TextFieldProps): default_2.ReactElement;
|
|
1109
|
+
|
|
1110
|
+
export declare namespace TextField {
|
|
1111
|
+
var displayName: string;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
/**
|
|
1115
|
+
* Combined props for TextField.
|
|
1116
|
+
* `error` is a string (error message) from FieldProps.
|
|
1117
|
+
* `id` is omitted — Field generates and manages it internally.
|
|
1118
|
+
*/
|
|
1119
|
+
export declare type TextFieldProps = FieldOwnProps & Omit<InputProps, 'id' | 'error'>;
|
|
1120
|
+
|
|
1018
1121
|
export declare const Toast: default_2.ComponentType<ToastProviderProps> & {
|
|
1019
1122
|
displayName: string;
|
|
1020
1123
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import { V as l } from "./VhyxUIProvider-DVFSW4q-.js";
|
|
2
|
-
import { B as
|
|
3
|
-
import { I as
|
|
4
|
-
import { T as
|
|
5
|
-
import { S as
|
|
6
|
-
import { C as
|
|
2
|
+
import { B as p } from "./Button-D7eX45GC.js";
|
|
3
|
+
import { I as S } from "./Input-BS_t1bl-.js";
|
|
4
|
+
import { T as P } from "./Textarea-CLrctxHU.js";
|
|
5
|
+
import { S as v } from "./Select-DjeJOdb7.js";
|
|
6
|
+
import { C as D } from "./Checkbox-DWl91ci_.js";
|
|
7
7
|
import { R as A, a as C } from "./RadioItem-CzHSS_qK.js";
|
|
8
8
|
import { S as R } from "./Switch-DOAZfSV0.js";
|
|
9
9
|
import { F as y, a as U, u as V } from "./Field-Bv07PL2M.js";
|
|
10
|
+
import { T as E } from "./TextField-DtXQQJJk.js";
|
|
11
|
+
import { S as L } from "./SelectField-DL7K4ZhA.js";
|
|
12
|
+
import { T as O } from "./TextareaField-CpqPinvx.js";
|
|
10
13
|
import { b as s, c as i, d as m } from "./Toast-0acAjZTB.js";
|
|
11
|
-
import { T as
|
|
12
|
-
import { A as
|
|
13
|
-
import { B as
|
|
14
|
-
import { P as
|
|
15
|
-
import { S as
|
|
16
|
-
import { D as
|
|
17
|
-
import { D as
|
|
18
|
-
import { T as
|
|
19
|
-
import { P as
|
|
20
|
-
import { C as
|
|
21
|
-
import { S as
|
|
22
|
-
import { T as
|
|
23
|
-
import { B as
|
|
24
|
-
import { P as
|
|
14
|
+
import { T as j, a as q } from "./Toast-0acAjZTB.js";
|
|
15
|
+
import { A as H } from "./Alert-am3ANPTH.js";
|
|
16
|
+
import { B as K } from "./Badge-Fuc7l-1E.js";
|
|
17
|
+
import { P as Q } from "./Progress-DWLr6Bq2.js";
|
|
18
|
+
import { S as X } from "./Spinner-CZSz1OpT.js";
|
|
19
|
+
import { D as Z } from "./Dialog-CtYu14zl.js";
|
|
20
|
+
import { D as rr } from "./Drawer-BFJxsPG1.js";
|
|
21
|
+
import { T as er } from "./Tooltip-BAmErB_g.js";
|
|
22
|
+
import { P as sr } from "./Popover-MxUovsIt.js";
|
|
23
|
+
import { C as fr } from "./Card-D7ZNeWtE.js";
|
|
24
|
+
import { S as mr } from "./Separator-DQT58t90.js";
|
|
25
|
+
import { T as xr } from "./Tabs-BTfm4LbV.js";
|
|
26
|
+
import { B as cr } from "./Breadcrumb-Db7ASomJ.js";
|
|
27
|
+
import { P as lr } from "./Pagination-C1h7OTgM.js";
|
|
25
28
|
const d = 5e3;
|
|
26
29
|
function t(e, a, r) {
|
|
27
30
|
const f = {
|
|
@@ -50,34 +53,37 @@ o.info = function(a, r) {
|
|
|
50
53
|
o.dismiss = function(a) {
|
|
51
54
|
a !== void 0 ? i(a) : m();
|
|
52
55
|
};
|
|
53
|
-
const
|
|
56
|
+
const n = o;
|
|
54
57
|
export {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
H as Alert,
|
|
59
|
+
K as Badge,
|
|
60
|
+
cr as Breadcrumb,
|
|
61
|
+
p as Button,
|
|
62
|
+
fr as Card,
|
|
63
|
+
D as Checkbox,
|
|
64
|
+
Z as Dialog,
|
|
65
|
+
rr as Drawer,
|
|
63
66
|
y as Field,
|
|
64
67
|
U as Form,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
S as Input,
|
|
69
|
+
lr as Pagination,
|
|
70
|
+
sr as Popover,
|
|
71
|
+
Q as Progress,
|
|
69
72
|
A as RadioGroup,
|
|
70
73
|
C as RadioItem,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
v as Select,
|
|
75
|
+
L as SelectField,
|
|
76
|
+
mr as Separator,
|
|
77
|
+
X as Spinner,
|
|
74
78
|
R as Switch,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
xr as Tabs,
|
|
80
|
+
E as TextField,
|
|
81
|
+
P as Textarea,
|
|
82
|
+
O as TextareaField,
|
|
83
|
+
j as Toast,
|
|
84
|
+
q as ToastProvider,
|
|
85
|
+
er as Tooltip,
|
|
80
86
|
l as VhyxUIProvider,
|
|
81
|
-
|
|
87
|
+
n as toast,
|
|
82
88
|
V as useFormContext
|
|
83
89
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./SelectField-BYmKwRVU.cjs");exports.SelectField=e.SelectField;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Field-owned props — picked from FieldProps without the HTML div base. */
|
|
4
|
+
declare type FieldOwnProps = Pick<FieldProps, 'name' | 'label' | 'hint' | 'error' | 'required' | 'optional' | 'layout'>;
|
|
5
|
+
|
|
6
|
+
/** Props for the Field component — the label/input/hint/error assembly layer. */
|
|
7
|
+
declare interface FieldProps extends Omit<default_2.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
8
|
+
/**
|
|
9
|
+
* Field name — used to read validation errors from the parent Form context
|
|
10
|
+
* when react-hook-form is wired up.
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
/** Label rendered above (or beside) the input. */
|
|
14
|
+
label?: default_2.ReactNode;
|
|
15
|
+
/** Helper text rendered below the input. Connected via aria-describedby. */
|
|
16
|
+
hint?: default_2.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Error message. When set, the child input receives aria-invalid and
|
|
19
|
+
* data-error attributes and the error text is announced as a live region.
|
|
20
|
+
* If absent, Field reads the error from the parent Form context automatically.
|
|
21
|
+
*/
|
|
22
|
+
error?: string;
|
|
23
|
+
/** When true, renders a required indicator (*) next to the label. */
|
|
24
|
+
required?: boolean;
|
|
25
|
+
/** When true, renders an optional indicator next to the label. */
|
|
26
|
+
optional?: boolean;
|
|
27
|
+
/** Field layout. Overrides the parent Form layout when set. @default 'vertical' */
|
|
28
|
+
layout?: 'vertical' | 'horizontal';
|
|
29
|
+
/** The single interactive child element (Input, Textarea, Select, etc.). */
|
|
30
|
+
children: default_2.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* SelectField — convenience compound of Field + Select.
|
|
35
|
+
*
|
|
36
|
+
* Renders a labelled dropdown with hint, error, and required indicator
|
|
37
|
+
* fully wired. Prefer this over manually composing Field + Select for
|
|
38
|
+
* single-selection dropdowns driven by a flat options array.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* <SelectField
|
|
42
|
+
* name="country"
|
|
43
|
+
* label="Country"
|
|
44
|
+
* value={value}
|
|
45
|
+
* onValueChange={setValue}
|
|
46
|
+
* options={[{ label: 'United States', value: 'us' }]}
|
|
47
|
+
* placeholder="Select a country"
|
|
48
|
+
* />
|
|
49
|
+
*/
|
|
50
|
+
export declare function SelectField({ name, label, hint, error, required, optional, layout, options, placeholder, value, onValueChange, disabled, size, }: SelectFieldProps): default_2.ReactElement;
|
|
51
|
+
|
|
52
|
+
export declare namespace SelectField {
|
|
53
|
+
var displayName: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** A single option rendered inside SelectField. */
|
|
57
|
+
export declare interface SelectFieldOption {
|
|
58
|
+
label: string;
|
|
59
|
+
value: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Props for SelectField.
|
|
64
|
+
* `error` is a string (error message) from FieldProps.
|
|
65
|
+
* `placeholder` is passed to the root Select (not to Select.Trigger).
|
|
66
|
+
*/
|
|
67
|
+
export declare interface SelectFieldProps extends FieldOwnProps {
|
|
68
|
+
/** The currently selected value (controlled). */
|
|
69
|
+
value: string;
|
|
70
|
+
/** Called when a new option is selected. */
|
|
71
|
+
onValueChange: (value: string) => void;
|
|
72
|
+
/** Options to render inside the dropdown. */
|
|
73
|
+
options: SelectFieldOption[];
|
|
74
|
+
/** Placeholder shown in the trigger when no value is selected. */
|
|
75
|
+
placeholder?: string;
|
|
76
|
+
/** When true, the trigger is disabled. */
|
|
77
|
+
disabled?: boolean;
|
|
78
|
+
/** Size applied to the Select and its sub-components. @default 'md' */
|
|
79
|
+
size?: 'sm' | 'md' | 'lg';
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TextareaField-D234Lyi_.cjs");exports.TextareaField=e.TextareaField;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ComponentContract } from '@vhyxui/core';
|
|
2
|
+
import { default as default_2 } from 'react';
|
|
3
|
+
|
|
4
|
+
/** Field-owned props — pulled from FieldProps without the HTML div base to avoid event-handler conflicts. */
|
|
5
|
+
declare type FieldOwnProps = Pick<FieldProps, 'name' | 'label' | 'hint' | 'error' | 'required' | 'optional' | 'layout'>;
|
|
6
|
+
|
|
7
|
+
/** Props for the Field component — the label/input/hint/error assembly layer. */
|
|
8
|
+
declare interface FieldProps extends Omit<default_2.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
9
|
+
/**
|
|
10
|
+
* Field name — used to read validation errors from the parent Form context
|
|
11
|
+
* when react-hook-form is wired up.
|
|
12
|
+
*/
|
|
13
|
+
name: string;
|
|
14
|
+
/** Label rendered above (or beside) the input. */
|
|
15
|
+
label?: default_2.ReactNode;
|
|
16
|
+
/** Helper text rendered below the input. Connected via aria-describedby. */
|
|
17
|
+
hint?: default_2.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Error message. When set, the child input receives aria-invalid and
|
|
20
|
+
* data-error attributes and the error text is announced as a live region.
|
|
21
|
+
* If absent, Field reads the error from the parent Form context automatically.
|
|
22
|
+
*/
|
|
23
|
+
error?: string;
|
|
24
|
+
/** When true, renders a required indicator (*) next to the label. */
|
|
25
|
+
required?: boolean;
|
|
26
|
+
/** When true, renders an optional indicator next to the label. */
|
|
27
|
+
optional?: boolean;
|
|
28
|
+
/** Field layout. Overrides the parent Form layout when set. @default 'vertical' */
|
|
29
|
+
layout?: 'vertical' | 'horizontal';
|
|
30
|
+
/** The single interactive child element (Input, Textarea, Select, etc.). */
|
|
31
|
+
children: default_2.ReactNode;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* TextareaField — convenience compound of Field + Textarea.
|
|
36
|
+
*
|
|
37
|
+
* Renders a labelled multi-line textarea with hint, error, and required
|
|
38
|
+
* indicator fully wired. Prefer this over manually composing Field + Textarea.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* <TextareaField name="bio" label="Bio" minRows={4} placeholder="Tell us about yourself" />
|
|
42
|
+
*/
|
|
43
|
+
export declare function TextareaField({ name, label, hint, error, required, optional, layout, ...textareaProps }: TextareaFieldProps): default_2.ReactElement;
|
|
44
|
+
|
|
45
|
+
export declare namespace TextareaField {
|
|
46
|
+
var displayName: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Combined props for TextareaField.
|
|
51
|
+
* `error` is a string (error message) from FieldProps.
|
|
52
|
+
* `id` is omitted — Field generates and manages it internally.
|
|
53
|
+
*/
|
|
54
|
+
export declare type TextareaFieldProps = FieldOwnProps & Omit<TextareaProps, 'id' | 'error'>;
|
|
55
|
+
|
|
56
|
+
/** Props for the Textarea component. */
|
|
57
|
+
declare interface TextareaProps extends default_2.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
58
|
+
/** Size of the textarea. @default 'md' */
|
|
59
|
+
size?: TextareaSize;
|
|
60
|
+
/**
|
|
61
|
+
* Resize behaviour.
|
|
62
|
+
* 'auto' makes the textarea grow with content up to maxRows.
|
|
63
|
+
* @default 'vertical'
|
|
64
|
+
*/
|
|
65
|
+
resize?: TextareaResize;
|
|
66
|
+
/** Minimum number of visible rows. @default 3 */
|
|
67
|
+
minRows?: number;
|
|
68
|
+
/** Maximum number of rows before scroll activates. Applies when resize='auto'. */
|
|
69
|
+
maxRows?: number;
|
|
70
|
+
/** When true, renders a character count below the textarea. Requires maxLength. */
|
|
71
|
+
showCount?: boolean;
|
|
72
|
+
/** When true, applies error visual state and sets aria-invalid. */
|
|
73
|
+
error?: boolean;
|
|
74
|
+
/** VhyxSeal contract override — merged with the default textarea contract. */
|
|
75
|
+
contract?: Partial<ComponentContract>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Resize behaviour for the textarea. */
|
|
79
|
+
declare type TextareaResize = 'none' | 'vertical' | 'horizontal' | 'both' | 'auto';
|
|
80
|
+
|
|
81
|
+
/** Size tokens available on the Textarea component. */
|
|
82
|
+
declare type TextareaSize = 'sm' | 'md' | 'lg';
|
|
83
|
+
|
|
84
|
+
export { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TextField-C3r-6jr6.cjs");exports.TextField=e.TextField;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ComponentContract } from '@vhyxui/core';
|
|
2
|
+
import { default as default_2 } from 'react';
|
|
3
|
+
|
|
4
|
+
/** Field-owned props — pulled from FieldProps without the HTML div base to avoid event-handler conflicts. */
|
|
5
|
+
declare type FieldOwnProps = Pick<FieldProps, 'name' | 'label' | 'hint' | 'error' | 'required' | 'optional' | 'layout'>;
|
|
6
|
+
|
|
7
|
+
/** Props for the Field component — the label/input/hint/error assembly layer. */
|
|
8
|
+
declare interface FieldProps extends Omit<default_2.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
9
|
+
/**
|
|
10
|
+
* Field name — used to read validation errors from the parent Form context
|
|
11
|
+
* when react-hook-form is wired up.
|
|
12
|
+
*/
|
|
13
|
+
name: string;
|
|
14
|
+
/** Label rendered above (or beside) the input. */
|
|
15
|
+
label?: default_2.ReactNode;
|
|
16
|
+
/** Helper text rendered below the input. Connected via aria-describedby. */
|
|
17
|
+
hint?: default_2.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Error message. When set, the child input receives aria-invalid and
|
|
20
|
+
* data-error attributes and the error text is announced as a live region.
|
|
21
|
+
* If absent, Field reads the error from the parent Form context automatically.
|
|
22
|
+
*/
|
|
23
|
+
error?: string;
|
|
24
|
+
/** When true, renders a required indicator (*) next to the label. */
|
|
25
|
+
required?: boolean;
|
|
26
|
+
/** When true, renders an optional indicator next to the label. */
|
|
27
|
+
optional?: boolean;
|
|
28
|
+
/** Field layout. Overrides the parent Form layout when set. @default 'vertical' */
|
|
29
|
+
layout?: 'vertical' | 'horizontal';
|
|
30
|
+
/** The single interactive child element (Input, Textarea, Select, etc.). */
|
|
31
|
+
children: default_2.ReactNode;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Props for the Input component. */
|
|
35
|
+
declare interface InputProps extends Omit<default_2.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
|
|
36
|
+
/** Size of the input, maps to --vhyx-size-* height tokens. @default 'md' */
|
|
37
|
+
size?: InputSize;
|
|
38
|
+
/** Optional icon element rendered inside the input. */
|
|
39
|
+
icon?: default_2.ReactNode;
|
|
40
|
+
/** Side the icon appears on. @default 'left' */
|
|
41
|
+
iconPosition?: 'left' | 'right';
|
|
42
|
+
/** Content rendered after the input (inside the wrapper, to the right). */
|
|
43
|
+
suffix?: default_2.ReactNode;
|
|
44
|
+
/** Content rendered before the input (inside the wrapper, to the left). */
|
|
45
|
+
prefix?: default_2.ReactNode;
|
|
46
|
+
/** When true, always shows a clear button regardless of type. */
|
|
47
|
+
clearable?: boolean;
|
|
48
|
+
/** Called when the clear button is clicked. */
|
|
49
|
+
onClear?: () => void;
|
|
50
|
+
/** When true, applies the error visual state and sets aria-invalid. */
|
|
51
|
+
error?: boolean;
|
|
52
|
+
/** VhyxSeal contract override — merged with the default input contract. */
|
|
53
|
+
contract?: Partial<ComponentContract>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Size tokens available on the Input component. */
|
|
57
|
+
declare type InputSize = 'sm' | 'md' | 'lg';
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* TextField — convenience compound of Field + Input.
|
|
61
|
+
*
|
|
62
|
+
* Renders a labelled text input with hint, error, and required indicator
|
|
63
|
+
* fully wired. Prefer this over manually composing Field + Input for
|
|
64
|
+
* single-line text inputs.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* <TextField name="email" label="Email" type="email" placeholder="you@example.com" required />
|
|
68
|
+
*/
|
|
69
|
+
export declare function TextField({ name, label, hint, error, required, optional, layout, ...inputProps }: TextFieldProps): default_2.ReactElement;
|
|
70
|
+
|
|
71
|
+
export declare namespace TextField {
|
|
72
|
+
var displayName: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Combined props for TextField.
|
|
77
|
+
* `error` is a string (error message) from FieldProps.
|
|
78
|
+
* `id` is omitted — Field generates and manages it internally.
|
|
79
|
+
*/
|
|
80
|
+
export declare type TextFieldProps = FieldOwnProps & Omit<InputProps, 'id' | 'error'>;
|
|
81
|
+
|
|
82
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vhyxui/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3-alpha",
|
|
4
4
|
"description": "VhyxUI React components — accessible, motion-first, agent-ready",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -124,6 +124,21 @@
|
|
|
124
124
|
"require": "./dist/pagination.cjs",
|
|
125
125
|
"types": "./dist/pagination.d.ts"
|
|
126
126
|
},
|
|
127
|
+
"./textfield": {
|
|
128
|
+
"import": "./dist/textfield.js",
|
|
129
|
+
"require": "./dist/textfield.cjs",
|
|
130
|
+
"types": "./dist/textfield.d.ts"
|
|
131
|
+
},
|
|
132
|
+
"./selectfield": {
|
|
133
|
+
"import": "./dist/selectfield.js",
|
|
134
|
+
"require": "./dist/selectfield.cjs",
|
|
135
|
+
"types": "./dist/selectfield.d.ts"
|
|
136
|
+
},
|
|
137
|
+
"./textareafield": {
|
|
138
|
+
"import": "./dist/textareafield.js",
|
|
139
|
+
"require": "./dist/textareafield.cjs",
|
|
140
|
+
"types": "./dist/textareafield.d.ts"
|
|
141
|
+
},
|
|
127
142
|
"./test-utils": {
|
|
128
143
|
"import": "./dist/test-utils.js",
|
|
129
144
|
"require": "./dist/test-utils.cjs",
|