@vhyxui/react 0.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/Alert-BJ1O0bnK.cjs +1 -0
  2. package/dist/Alert-am3ANPTH.js +99 -0
  3. package/dist/Badge-Fuc7l-1E.js +38 -0
  4. package/dist/Badge-RM7n86Rq.cjs +1 -0
  5. package/dist/Breadcrumb-Db7ASomJ.js +90 -0
  6. package/dist/Breadcrumb-StitgXXx.cjs +1 -0
  7. package/dist/Button-B32xz0b5.js +58 -0
  8. package/dist/Button-CfYG4zkG.cjs +1 -0
  9. package/dist/Card-D7ZNeWtE.js +75 -0
  10. package/dist/Card-d5xrWgQS.cjs +1 -0
  11. package/dist/Checkbox-DWl91ci_.js +92 -0
  12. package/dist/Checkbox-DvkT6QP9.cjs +1 -0
  13. package/dist/Dialog-CtYu14zl.js +245 -0
  14. package/dist/Dialog-gPT4noD8.cjs +1 -0
  15. package/dist/Drawer-BFJxsPG1.js +246 -0
  16. package/dist/Drawer-BygSIQQn.cjs +1 -0
  17. package/dist/Field-Bv07PL2M.js +120 -0
  18. package/dist/Field-D6FSsUGj.cjs +1 -0
  19. package/dist/Input-Dqt5q33I.js +151 -0
  20. package/dist/Input-OFmZxiHe.cjs +1 -0
  21. package/dist/Pagination-C1h7OTgM.js +128 -0
  22. package/dist/Pagination-CmmcBPNz.cjs +1 -0
  23. package/dist/Popover-BPFkS4xn.cjs +1 -0
  24. package/dist/Popover-MxUovsIt.js +194 -0
  25. package/dist/Progress-DWLr6Bq2.js +75 -0
  26. package/dist/Progress-FO-4WX0i.cjs +1 -0
  27. package/dist/RadioItem-BfkTHBxQ.cjs +1 -0
  28. package/dist/RadioItem-CzHSS_qK.js +141 -0
  29. package/dist/Select-C9yB2B8M.cjs +1 -0
  30. package/dist/Select-DjeJOdb7.js +327 -0
  31. package/dist/Separator-C5lPGzes.cjs +1 -0
  32. package/dist/Separator-DQT58t90.js +52 -0
  33. package/dist/Spinner-Cd5tcOLS.js +61 -0
  34. package/dist/Spinner-DSHhLV-r.cjs +1 -0
  35. package/dist/Switch-BU_Tcttb.cjs +1 -0
  36. package/dist/Switch-DOAZfSV0.js +64 -0
  37. package/dist/Tabs-BTfm4LbV.js +220 -0
  38. package/dist/Tabs-DuU02-UD.cjs +1 -0
  39. package/dist/Textarea-CLrctxHU.js +104 -0
  40. package/dist/Textarea-H6evM8L4.cjs +1 -0
  41. package/dist/Toast-0acAjZTB.js +167 -0
  42. package/dist/Toast-ndaxbpcV.cjs +1 -0
  43. package/dist/Tooltip-BAmErB_g.js +107 -0
  44. package/dist/Tooltip-CCd6VRvZ.cjs +1 -0
  45. package/dist/VhyxUIProvider-C9NxI-tU.cjs +1 -0
  46. package/dist/VhyxUIProvider-D1vNoiIk.js +34 -0
  47. package/dist/alert.cjs +1 -0
  48. package/dist/alert.d.ts +25 -0
  49. package/dist/alert.js +4 -0
  50. package/dist/badge.cjs +1 -0
  51. package/dist/badge.d.ts +31 -0
  52. package/dist/badge.js +4 -0
  53. package/dist/breadcrumb.cjs +1 -0
  54. package/dist/breadcrumb.d.ts +81 -0
  55. package/dist/breadcrumb.js +4 -0
  56. package/dist/button.cjs +1 -0
  57. package/dist/button.d.ts +36 -0
  58. package/dist/button.js +4 -0
  59. package/dist/card.cjs +1 -0
  60. package/dist/card.d.ts +72 -0
  61. package/dist/card.js +4 -0
  62. package/dist/checkbox.cjs +1 -0
  63. package/dist/checkbox.d.ts +33 -0
  64. package/dist/checkbox.js +4 -0
  65. package/dist/dialog.cjs +1 -0
  66. package/dist/dialog.d.ts +112 -0
  67. package/dist/dialog.js +4 -0
  68. package/dist/drawer.cjs +1 -0
  69. package/dist/drawer.d.ts +110 -0
  70. package/dist/drawer.js +4 -0
  71. package/dist/form.cjs +1 -0
  72. package/dist/form.d.ts +116 -0
  73. package/dist/form.js +6 -0
  74. package/dist/index.cjs +1 -0
  75. package/dist/index.d.ts +1184 -0
  76. package/dist/index.js +83 -0
  77. package/dist/input.cjs +1 -0
  78. package/dist/input.d.ts +31 -0
  79. package/dist/input.js +4 -0
  80. package/dist/jsx-runtime-BRMkMA8J.cjs +22 -0
  81. package/dist/jsx-runtime-CL69jGNW.js +279 -0
  82. package/dist/pagination.cjs +1 -0
  83. package/dist/pagination.d.ts +32 -0
  84. package/dist/pagination.js +4 -0
  85. package/dist/popover.cjs +1 -0
  86. package/dist/popover.d.ts +72 -0
  87. package/dist/popover.js +4 -0
  88. package/dist/progress.cjs +1 -0
  89. package/dist/progress.d.ts +35 -0
  90. package/dist/progress.js +4 -0
  91. package/dist/radio.cjs +1 -0
  92. package/dist/radio.d.ts +47 -0
  93. package/dist/radio.js +5 -0
  94. package/dist/select.cjs +1 -0
  95. package/dist/select.d.ts +97 -0
  96. package/dist/select.js +4 -0
  97. package/dist/separator.cjs +1 -0
  98. package/dist/separator.d.ts +21 -0
  99. package/dist/separator.js +4 -0
  100. package/dist/spinner.cjs +1 -0
  101. package/dist/spinner.d.ts +24 -0
  102. package/dist/spinner.js +4 -0
  103. package/dist/style.css +1 -0
  104. package/dist/switch.cjs +1 -0
  105. package/dist/switch.d.ts +28 -0
  106. package/dist/switch.js +4 -0
  107. package/dist/tabs.cjs +1 -0
  108. package/dist/tabs.d.ts +59 -0
  109. package/dist/tabs.js +4 -0
  110. package/dist/test-utils.cjs +1 -0
  111. package/dist/test-utils.d.ts +5 -0
  112. package/dist/test-utils.js +12 -0
  113. package/dist/textarea.cjs +1 -0
  114. package/dist/textarea.d.ts +34 -0
  115. package/dist/textarea.js +4 -0
  116. package/dist/toast.cjs +1 -0
  117. package/dist/toast.d.ts +28 -0
  118. package/dist/toast.js +5 -0
  119. package/dist/tooltip.cjs +1 -0
  120. package/dist/tooltip.d.ts +32 -0
  121. package/dist/tooltip.js +4 -0
  122. package/dist/useId-BGRmH6iF.js +8 -0
  123. package/dist/useId-D2AEOm2G.cjs +1 -0
  124. package/package.json +170 -0
  125. package/style.css +1 -0
package/dist/form.d.ts ADDED
@@ -0,0 +1,116 @@
1
+ import { default as default_2 } from 'react';
2
+ import { FieldValues } from 'react-hook-form';
3
+ import { FormState } from 'react-hook-form';
4
+ import { UseFormRegister } from 'react-hook-form';
5
+ import { UseFormReturn } from 'react-hook-form';
6
+
7
+ /**
8
+ * Field — the missing layer. Label + input + hint + error in one first-class component.
9
+ *
10
+ * Automatically:
11
+ * - Generates unique IDs and connects label htmlFor → input id
12
+ * - Wires aria-describedby from input → hint and/or error text
13
+ * - Propagates aria-invalid and data-error to the child when an error is set
14
+ * - Reads validation errors from the parent Form context (react-hook-form)
15
+ *
16
+ * Developers rebuild Field on every project. VhyxUI ships it first class.
17
+ *
18
+ * @example
19
+ * <Field name="email" label="Email" hint="We'll never share it" required>
20
+ * <Input type="email" />
21
+ * </Field>
22
+ */
23
+ export declare function Field({ name, label, hint, error, required, optional, layout, children, className, ...htmlProps }: FieldProps): default_2.ReactElement;
24
+
25
+ export declare namespace Field {
26
+ var displayName: string;
27
+ }
28
+
29
+ /** Props for the Field component — the label/input/hint/error assembly layer. */
30
+ export declare interface FieldProps extends Omit<default_2.HTMLAttributes<HTMLDivElement>, 'children'> {
31
+ /**
32
+ * Field name — used to read validation errors from the parent Form context
33
+ * when react-hook-form is wired up.
34
+ */
35
+ name: string;
36
+ /** Label rendered above (or beside) the input. */
37
+ label?: default_2.ReactNode;
38
+ /** Helper text rendered below the input. Connected via aria-describedby. */
39
+ hint?: default_2.ReactNode;
40
+ /**
41
+ * Error message. When set, the child input receives aria-invalid and
42
+ * data-error attributes and the error text is announced as a live region.
43
+ * If absent, Field reads the error from the parent Form context automatically.
44
+ */
45
+ error?: string;
46
+ /** When true, renders a required indicator (*) next to the label. */
47
+ required?: boolean;
48
+ /** When true, renders an optional indicator next to the label. */
49
+ optional?: boolean;
50
+ /** Field layout. Overrides the parent Form layout when set. @default 'vertical' */
51
+ layout?: 'vertical' | 'horizontal';
52
+ /** The single interactive child element (Input, Textarea, Select, etc.). */
53
+ children: default_2.ReactNode;
54
+ }
55
+
56
+ /** Minimal field validation state used by Field to read error messages. */
57
+ declare type FieldValidationState = {
58
+ error?: {
59
+ message?: string;
60
+ };
61
+ invalid: boolean;
62
+ isDirty: boolean;
63
+ isTouched: boolean;
64
+ isValidating: boolean;
65
+ };
66
+
67
+ export declare const Form: default_2.ForwardRefExoticComponent<default_2.PropsWithoutRef<FormProps> & default_2.RefAttributes<HTMLFormElement>>;
68
+
69
+ /** Value provided by the Form context to all descendant Fields. */
70
+ export declare interface FormContextValue {
71
+ /** react-hook-form form state, available when a form prop is provided. */
72
+ formState?: FormState<FieldValues>;
73
+ /** react-hook-form register function, available when a form prop is provided. */
74
+ register?: UseFormRegister<FieldValues>;
75
+ /** Per-field state accessor from react-hook-form, available when a form prop is provided. */
76
+ getFieldState?: (name: string) => FieldValidationState;
77
+ /** When true, all form controls in this form are disabled. */
78
+ disabled: boolean;
79
+ /** Size applied to all controls in this form. */
80
+ size: 'sm' | 'md' | 'lg';
81
+ /** Layout direction of fields in this form. */
82
+ layout: 'vertical' | 'horizontal' | 'inline';
83
+ }
84
+
85
+ /** Props for the Form component. */
86
+ export declare interface FormProps extends default_2.FormHTMLAttributes<HTMLFormElement> {
87
+ /**
88
+ * react-hook-form return value from useForm().
89
+ * When provided, Field components automatically read validation errors,
90
+ * and form submission is handled via form.handleSubmit(onSubmit).
91
+ */
92
+ form?: UseFormReturn<FieldValues>;
93
+ /** Field layout within this form. @default 'vertical' */
94
+ layout?: 'vertical' | 'horizontal' | 'inline';
95
+ /** Size applied to all controls in this form. @default 'md' */
96
+ size?: 'sm' | 'md' | 'lg';
97
+ /**
98
+ * When true, all form controls are disabled.
99
+ * Propagated to Field children via context.
100
+ */
101
+ disabled?: boolean;
102
+ /**
103
+ * Called with validated form data on submission.
104
+ * When form prop is provided, this is called by react-hook-form after validation.
105
+ * When form prop is absent, called on native form submit with empty FieldValues.
106
+ */
107
+ onSubmit?: (data: FieldValues) => void | Promise<void>;
108
+ }
109
+
110
+ /**
111
+ * Returns the current Form context value.
112
+ * Returns null when used outside a Form — Field and other consumers handle this gracefully.
113
+ */
114
+ export declare function useFormContext(): FormContextValue | null;
115
+
116
+ export { }
package/dist/form.js ADDED
@@ -0,0 +1,6 @@
1
+ import { F as e, a as r, u as s } from "./Field-Bv07PL2M.js";
2
+ export {
3
+ e as Field,
4
+ r as Form,
5
+ s as useFormContext
6
+ };
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./VhyxUIProvider-C9NxI-tU.cjs"),d=require("./Button-CfYG4zkG.cjs"),l=require("./Input-OFmZxiHe.cjs"),T=require("./Textarea-H6evM8L4.cjs"),q=require("./Select-C9yB2B8M.cjs"),g=require("./Checkbox-DvkT6QP9.cjs"),u=require("./RadioItem-BfkTHBxQ.cjs"),m=require("./Switch-BU_Tcttb.cjs"),s=require("./Field-D6FSsUGj.cjs"),t=require("./Toast-ndaxbpcV.cjs"),P=require("./Alert-BJ1O0bnK.cjs"),f=require("./Badge-RM7n86Rq.cjs"),b=require("./Progress-FO-4WX0i.cjs"),S=require("./Spinner-DSHhLV-r.cjs"),v=require("./Dialog-gPT4noD8.cjs"),x=require("./Drawer-BygSIQQn.cjs"),I=require("./Tooltip-CCd6VRvZ.cjs"),h=require("./Popover-BPFkS4xn.cjs"),w=require("./Card-d5xrWgQS.cjs"),B=require("./Separator-C5lPGzes.cjs"),F=require("./Tabs-DuU02-UD.cjs"),C=require("./Breadcrumb-StitgXXx.cjs"),D=require("./Pagination-CmmcBPNz.cjs"),y=5e3;function o(i,r,e){const n={message:i,variant:r,duration:(e==null?void 0:e.duration)??y,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 A=a;exports.VhyxUIProvider=c.VhyxUIProvider;exports.Button=d.Button;exports.Input=l.Input;exports.Textarea=T.Textarea;exports.Select=q.Select;exports.Checkbox=g.Checkbox;exports.RadioGroup=u.RadioGroup;exports.RadioItem=u.RadioItem;exports.Switch=m.Switch;exports.Field=s.Field;exports.Form=s.Form;exports.useFormContext=s.useFormContext;exports.Toast=t.Toast;exports.ToastProvider=t.ToastProvider;exports.Alert=P.Alert;exports.Badge=f.Badge;exports.Progress=b.Progress;exports.Spinner=S.Spinner;exports.Dialog=v.Dialog;exports.Drawer=x.Drawer;exports.Tooltip=I.Tooltip;exports.Popover=h.Popover;exports.Card=w.Card;exports.Separator=B.Separator;exports.Tabs=F.Tabs;exports.Breadcrumb=C.Breadcrumb;exports.Pagination=D.Pagination;exports.toast=A;