@vhyxui/react 0.1.2-alpha.2 → 0.2.0-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/{Badge-Fuc7l-1E.js → Badge-Bbxb4wyt.js} +7 -7
- package/dist/{Badge-RM7n86Rq.cjs → Badge-SBO9tGzn.cjs} +1 -1
- package/dist/{Button-D7eX45GC.js → Button-DDMc7-3S.js} +28 -28
- package/dist/{Button-AkUYT9eN.cjs → Button-akOSYEu9.cjs} +1 -1
- package/dist/Card-DSCA-Igh.cjs +1 -0
- package/dist/Card-Dh9Pcmfa.js +79 -0
- package/dist/Popover-BHGX_cC4.cjs +1 -0
- package/dist/Popover-u9vlClum.js +211 -0
- package/dist/Select-CGfKq69f.cjs +1 -0
- package/dist/Select-DHalg36V.js +344 -0
- package/dist/SelectField-DG7SlT9m.cjs +1 -0
- package/dist/SelectField-DTfYCDWa.js +49 -0
- package/dist/{Spinner-CZSz1OpT.js → Spinner-BYi9eTfl.js} +19 -19
- package/dist/Spinner-CeIDpqkx.cjs +1 -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/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +129 -6
- package/dist/index.js +47 -41
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts +7 -1
- package/dist/popover.js +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +19 -5
- package/dist/select.js +1 -1
- package/dist/selectfield.cjs +1 -0
- package/dist/selectfield.d.ts +82 -0
- package/dist/selectfield.js +4 -0
- package/dist/spinner.cjs +1 -1
- package/dist/spinner.js +1 -1
- package/dist/style.css +1 -1
- 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
- package/dist/Card-D7ZNeWtE.js +0 -75
- package/dist/Card-d5xrWgQS.cjs +0 -1
- package/dist/Popover-BPFkS4xn.cjs +0 -1
- package/dist/Popover-MxUovsIt.js +0 -194
- package/dist/Select-C9yB2B8M.cjs +0 -1
- package/dist/Select-DjeJOdb7.js +0 -327
- package/dist/Spinner-BZGPmp9c.cjs +0 -1
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
|
/**
|
|
@@ -663,8 +672,14 @@ export declare interface PopoverCloseProps extends default_2.ButtonHTMLAttribute
|
|
|
663
672
|
/**
|
|
664
673
|
* The floating panel. Rendered in a portal.
|
|
665
674
|
* Non-modal (aria-modal="false") — focus is NOT trapped.
|
|
675
|
+
*
|
|
676
|
+
* Deferred to client-only via `mounted` state, same pattern as
|
|
677
|
+
* Select.Content: SSR and client initial renders both produce null,
|
|
678
|
+
* eliminating both a hydration mismatch and a `document is not defined`
|
|
679
|
+
* crash from `ReactDOM.createPortal(..., document.body)` if this is open
|
|
680
|
+
* on first render (`document` doesn't exist during SSR).
|
|
666
681
|
*/
|
|
667
|
-
declare function PopoverContent({ children, className, side, align, ...rest }: PopoverContentProps): default_2.ReactPortal | null;
|
|
682
|
+
declare function PopoverContent({ children, className, side, align, style, ...rest }: PopoverContentProps): default_2.ReactPortal | null;
|
|
668
683
|
|
|
669
684
|
declare namespace PopoverContent {
|
|
670
685
|
var displayName: string;
|
|
@@ -792,7 +807,7 @@ export declare const Select: default_2.ComponentType<SelectProps & default_2.Ref
|
|
|
792
807
|
* SelectItem labels register on their own mount effects after this content
|
|
793
808
|
* mounts client-side, so the trigger label display is updated via state.
|
|
794
809
|
*/
|
|
795
|
-
declare function SelectContent({ children, className, ...rest }: SelectContentProps): default_2.ReactPortal | null;
|
|
810
|
+
declare function SelectContent({ children, className, style, ...rest }: SelectContentProps): default_2.ReactPortal | null;
|
|
796
811
|
|
|
797
812
|
declare namespace SelectContent {
|
|
798
813
|
var displayName: string;
|
|
@@ -802,6 +817,55 @@ export declare interface SelectContentProps extends default_2.HTMLAttributes<HTM
|
|
|
802
817
|
children?: default_2.ReactNode;
|
|
803
818
|
}
|
|
804
819
|
|
|
820
|
+
/**
|
|
821
|
+
* SelectField — convenience compound of Field + Select.
|
|
822
|
+
*
|
|
823
|
+
* Renders a labelled dropdown with hint, error, and required indicator
|
|
824
|
+
* fully wired. Prefer this over manually composing Field + Select for
|
|
825
|
+
* single-selection dropdowns driven by a flat options array.
|
|
826
|
+
*
|
|
827
|
+
* @example
|
|
828
|
+
* <SelectField
|
|
829
|
+
* name="country"
|
|
830
|
+
* label="Country"
|
|
831
|
+
* value={value}
|
|
832
|
+
* onValueChange={setValue}
|
|
833
|
+
* options={[{ label: 'United States', value: 'us' }]}
|
|
834
|
+
* placeholder="Select a country"
|
|
835
|
+
* />
|
|
836
|
+
*/
|
|
837
|
+
export declare function SelectField({ name, label, hint, error, required, optional, layout, options, placeholder, value, onValueChange, disabled, size, }: SelectFieldProps): default_2.ReactElement;
|
|
838
|
+
|
|
839
|
+
export declare namespace SelectField {
|
|
840
|
+
var displayName: string;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/** A single option rendered inside SelectField. */
|
|
844
|
+
export declare interface SelectFieldOption {
|
|
845
|
+
label: string;
|
|
846
|
+
value: string;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* Props for SelectField.
|
|
851
|
+
* `error` is a string (error message) from FieldProps.
|
|
852
|
+
* `placeholder` is passed to the root Select (not to Select.Trigger).
|
|
853
|
+
*/
|
|
854
|
+
export declare interface SelectFieldProps extends FieldOwnProps_2 {
|
|
855
|
+
/** The currently selected value (controlled). */
|
|
856
|
+
value: string;
|
|
857
|
+
/** Called when a new option is selected. */
|
|
858
|
+
onValueChange: (value: string) => void;
|
|
859
|
+
/** Options to render inside the dropdown. */
|
|
860
|
+
options: SelectFieldOption[];
|
|
861
|
+
/** Placeholder shown in the trigger when no value is selected. */
|
|
862
|
+
placeholder?: string;
|
|
863
|
+
/** When true, the trigger is disabled. */
|
|
864
|
+
disabled?: boolean;
|
|
865
|
+
/** Size applied to the Select and its sub-components. @default 'md' */
|
|
866
|
+
size?: 'sm' | 'md' | 'lg';
|
|
867
|
+
}
|
|
868
|
+
|
|
805
869
|
declare function SelectGroup({ children, className, ...rest }: SelectGroupProps): default_2.ReactElement;
|
|
806
870
|
|
|
807
871
|
declare namespace SelectGroup {
|
|
@@ -860,12 +924,26 @@ export declare interface SelectSeparatorProps extends default_2.HTMLAttributes<H
|
|
|
860
924
|
/** Size tokens for Select. */
|
|
861
925
|
export declare type SelectSize = 'sm' | 'md' | 'lg';
|
|
862
926
|
|
|
863
|
-
|
|
927
|
+
declare type SelectTriggerBaseProps = Omit<default_2.ButtonHTMLAttributes<HTMLButtonElement>, 'children'> & {
|
|
864
928
|
/** Optional icon rendered on the right. Defaults to a chevron SVG. */
|
|
865
929
|
icon?: default_2.ReactNode;
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
930
|
+
};
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Select.Trigger's default render always shows the selected value + a
|
|
934
|
+
* chevron icon — it never renders custom content, so `children` is not
|
|
935
|
+
* part of the props shape unless `asChild` is used. Use `asChild` with a
|
|
936
|
+
* single child element to fully customize what the trigger renders.
|
|
937
|
+
*/
|
|
938
|
+
export declare type SelectTriggerProps = (SelectTriggerBaseProps & {
|
|
939
|
+
/** Render as the child element via Slot, merging Select.Trigger's behavior onto it. */
|
|
940
|
+
asChild: true;
|
|
941
|
+
/** The single custom trigger element `asChild` merges open/close + aria/keyboard behavior onto. */
|
|
942
|
+
children: default_2.ReactElement;
|
|
943
|
+
}) | (SelectTriggerBaseProps & {
|
|
944
|
+
asChild?: false;
|
|
945
|
+
children?: never;
|
|
946
|
+
});
|
|
869
947
|
|
|
870
948
|
export declare const Separator: default_2.ForwardRefExoticComponent<default_2.PropsWithoutRef<SeparatorProps> & default_2.RefAttributes<HTMLElement>>;
|
|
871
949
|
|
|
@@ -987,6 +1065,28 @@ export declare type TabsVariant = 'default' | 'pills' | 'underline' | 'enclosed'
|
|
|
987
1065
|
|
|
988
1066
|
export declare const Textarea: default_2.ForwardRefExoticComponent<default_2.PropsWithoutRef<TextareaProps> & default_2.RefAttributes<HTMLTextAreaElement>>;
|
|
989
1067
|
|
|
1068
|
+
/**
|
|
1069
|
+
* TextareaField — convenience compound of Field + Textarea.
|
|
1070
|
+
*
|
|
1071
|
+
* Renders a labelled multi-line textarea with hint, error, and required
|
|
1072
|
+
* indicator fully wired. Prefer this over manually composing Field + Textarea.
|
|
1073
|
+
*
|
|
1074
|
+
* @example
|
|
1075
|
+
* <TextareaField name="bio" label="Bio" minRows={4} placeholder="Tell us about yourself" />
|
|
1076
|
+
*/
|
|
1077
|
+
export declare function TextareaField({ name, label, hint, error, required, optional, layout, ...textareaProps }: TextareaFieldProps): default_2.ReactElement;
|
|
1078
|
+
|
|
1079
|
+
export declare namespace TextareaField {
|
|
1080
|
+
var displayName: string;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
/**
|
|
1084
|
+
* Combined props for TextareaField.
|
|
1085
|
+
* `error` is a string (error message) from FieldProps.
|
|
1086
|
+
* `id` is omitted — Field generates and manages it internally.
|
|
1087
|
+
*/
|
|
1088
|
+
export declare type TextareaFieldProps = FieldOwnProps_3 & Omit<TextareaProps, 'id' | 'error'>;
|
|
1089
|
+
|
|
990
1090
|
/** Props for the Textarea component. */
|
|
991
1091
|
export declare interface TextareaProps extends default_2.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
992
1092
|
/** Size of the textarea. @default 'md' */
|
|
@@ -1015,6 +1115,29 @@ export declare type TextareaResize = 'none' | 'vertical' | 'horizontal' | 'both'
|
|
|
1015
1115
|
/** Size tokens available on the Textarea component. */
|
|
1016
1116
|
export declare type TextareaSize = 'sm' | 'md' | 'lg';
|
|
1017
1117
|
|
|
1118
|
+
/**
|
|
1119
|
+
* TextField — convenience compound of Field + Input.
|
|
1120
|
+
*
|
|
1121
|
+
* Renders a labelled text input with hint, error, and required indicator
|
|
1122
|
+
* fully wired. Prefer this over manually composing Field + Input for
|
|
1123
|
+
* single-line text inputs.
|
|
1124
|
+
*
|
|
1125
|
+
* @example
|
|
1126
|
+
* <TextField name="email" label="Email" type="email" placeholder="you@example.com" required />
|
|
1127
|
+
*/
|
|
1128
|
+
export declare function TextField({ name, label, hint, error, required, optional, layout, ...inputProps }: TextFieldProps): default_2.ReactElement;
|
|
1129
|
+
|
|
1130
|
+
export declare namespace TextField {
|
|
1131
|
+
var displayName: string;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
/**
|
|
1135
|
+
* Combined props for TextField.
|
|
1136
|
+
* `error` is a string (error message) from FieldProps.
|
|
1137
|
+
* `id` is omitted — Field generates and manages it internally.
|
|
1138
|
+
*/
|
|
1139
|
+
export declare type TextFieldProps = FieldOwnProps & Omit<InputProps, 'id' | 'error'>;
|
|
1140
|
+
|
|
1018
1141
|
export declare const Toast: default_2.ComponentType<ToastProviderProps> & {
|
|
1019
1142
|
displayName: string;
|
|
1020
1143
|
};
|
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-DDMc7-3S.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-DHalg36V.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-DTfYCDWa.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-Bbxb4wyt.js";
|
|
17
|
+
import { P as Q } from "./Progress-DWLr6Bq2.js";
|
|
18
|
+
import { S as X } from "./Spinner-BYi9eTfl.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-u9vlClum.js";
|
|
23
|
+
import { C as fr } from "./Card-Dh9Pcmfa.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
|
};
|
package/dist/popover.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Popover-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Popover-BHGX_cC4.cjs");exports.Popover=e.Popover;
|
package/dist/popover.d.ts
CHANGED
|
@@ -32,8 +32,14 @@ export declare interface PopoverCloseProps extends default_2.ButtonHTMLAttribute
|
|
|
32
32
|
/**
|
|
33
33
|
* The floating panel. Rendered in a portal.
|
|
34
34
|
* Non-modal (aria-modal="false") — focus is NOT trapped.
|
|
35
|
+
*
|
|
36
|
+
* Deferred to client-only via `mounted` state, same pattern as
|
|
37
|
+
* Select.Content: SSR and client initial renders both produce null,
|
|
38
|
+
* eliminating both a hydration mismatch and a `document is not defined`
|
|
39
|
+
* crash from `ReactDOM.createPortal(..., document.body)` if this is open
|
|
40
|
+
* on first render (`document` doesn't exist during SSR).
|
|
35
41
|
*/
|
|
36
|
-
declare function PopoverContent({ children, className, side, align, ...rest }: PopoverContentProps): default_2.ReactPortal | null;
|
|
42
|
+
declare function PopoverContent({ children, className, side, align, style, ...rest }: PopoverContentProps): default_2.ReactPortal | null;
|
|
37
43
|
|
|
38
44
|
declare namespace PopoverContent {
|
|
39
45
|
var displayName: string;
|
package/dist/popover.js
CHANGED
package/dist/select.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Select-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Select-CGfKq69f.cjs");exports.Select=e.Select;
|
package/dist/select.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare const Select: default_2.ComponentType<SelectProps & default_2.Ref
|
|
|
19
19
|
* SelectItem labels register on their own mount effects after this content
|
|
20
20
|
* mounts client-side, so the trigger label display is updated via state.
|
|
21
21
|
*/
|
|
22
|
-
declare function SelectContent({ children, className, ...rest }: SelectContentProps): default_2.ReactPortal | null;
|
|
22
|
+
declare function SelectContent({ children, className, style, ...rest }: SelectContentProps): default_2.ReactPortal | null;
|
|
23
23
|
|
|
24
24
|
declare namespace SelectContent {
|
|
25
25
|
var displayName: string;
|
|
@@ -87,11 +87,25 @@ export declare interface SelectSeparatorProps extends default_2.HTMLAttributes<H
|
|
|
87
87
|
/** Size tokens for Select. */
|
|
88
88
|
export declare type SelectSize = 'sm' | 'md' | 'lg';
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
declare type SelectTriggerBaseProps = Omit<default_2.ButtonHTMLAttributes<HTMLButtonElement>, 'children'> & {
|
|
91
91
|
/** Optional icon rendered on the right. Defaults to a chevron SVG. */
|
|
92
92
|
icon?: default_2.ReactNode;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Select.Trigger's default render always shows the selected value + a
|
|
97
|
+
* chevron icon — it never renders custom content, so `children` is not
|
|
98
|
+
* part of the props shape unless `asChild` is used. Use `asChild` with a
|
|
99
|
+
* single child element to fully customize what the trigger renders.
|
|
100
|
+
*/
|
|
101
|
+
export declare type SelectTriggerProps = (SelectTriggerBaseProps & {
|
|
102
|
+
/** Render as the child element via Slot, merging Select.Trigger's behavior onto it. */
|
|
103
|
+
asChild: true;
|
|
104
|
+
/** The single custom trigger element `asChild` merges open/close + aria/keyboard behavior onto. */
|
|
105
|
+
children: default_2.ReactElement;
|
|
106
|
+
}) | (SelectTriggerBaseProps & {
|
|
107
|
+
asChild?: false;
|
|
108
|
+
children?: never;
|
|
109
|
+
});
|
|
96
110
|
|
|
97
111
|
export { }
|
package/dist/select.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./SelectField-DG7SlT9m.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 { }
|
package/dist/spinner.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Spinner-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Spinner-CeIDpqkx.cjs");exports.Spinner=e.Spinner;
|
package/dist/spinner.js
CHANGED