@facter/ds-core 1.33.11 → 1.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -80,6 +80,8 @@ interface InputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>,
80
80
  label?: string;
81
81
  error?: boolean;
82
82
  icon?: React$1.ComponentType<any>;
83
+ /** Extra ReactNode rendered after label text (used by Form.Input for tooltip icon) */
84
+ labelSuffix?: React$1.ReactNode;
83
85
  containerClassName?: string;
84
86
  labelClassName?: string;
85
87
  }
@@ -858,25 +860,6 @@ interface TextareaProps extends Omit<React$1.TextareaHTMLAttributes<HTMLTextArea
858
860
  }
859
861
  declare const Textarea: React$1.NamedExoticComponent<TextareaProps & React$1.RefAttributes<HTMLTextAreaElement>>;
860
862
 
861
- interface FormLabelProps extends React$1.LabelHTMLAttributes<HTMLLabelElement> {
862
- required?: boolean;
863
- }
864
- declare const FormLabel: React$1.ForwardRefExoticComponent<FormLabelProps & React$1.RefAttributes<HTMLLabelElement>>;
865
- interface FormDescriptionProps extends React$1.HTMLAttributes<HTMLParagraphElement> {
866
- }
867
- declare const FormDescription: React$1.ForwardRefExoticComponent<FormDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>>;
868
- interface FormErrorProps extends React$1.HTMLAttributes<HTMLParagraphElement> {
869
- message?: string;
870
- }
871
- declare const FormError: React$1.ForwardRefExoticComponent<FormErrorProps & React$1.RefAttributes<HTMLParagraphElement>>;
872
- interface FormFieldWrapperProps extends React$1.HTMLAttributes<HTMLDivElement> {
873
- label?: string;
874
- description?: string;
875
- required?: boolean;
876
- error?: string;
877
- }
878
- declare const FormFieldWrapper: React$1.ForwardRefExoticComponent<FormFieldWrapperProps & React$1.RefAttributes<HTMLDivElement>>;
879
-
880
863
  interface FormContextValue<T extends FieldValues = FieldValues> {
881
864
  form: UseFormReturn<T>;
882
865
  }
@@ -886,10 +869,17 @@ interface FormFieldContextValue {
886
869
  error?: string;
887
870
  isRequired?: boolean;
888
871
  }
872
+ interface FieldTooltipConfig {
873
+ title: string;
874
+ description: string;
875
+ }
876
+ type FieldTooltip = string | FieldTooltipConfig;
889
877
  interface BaseFieldProps<T extends FieldValues = FieldValues> {
890
878
  name: FieldPath<T>;
891
879
  label?: string;
892
880
  description?: string;
881
+ /** Tooltip shown via info icon next to the label. String or { title, description } */
882
+ tooltip?: FieldTooltip;
893
883
  required?: boolean;
894
884
  disabled?: boolean;
895
885
  className?: string;
@@ -916,18 +906,11 @@ interface SelectOption {
916
906
  interface FormSelectProps<T extends FieldValues = FieldValues> extends BaseFieldProps<T> {
917
907
  options: SelectOption[];
918
908
  placeholder?: string;
919
- multiple?: boolean;
920
- searchable?: boolean;
921
- clearable?: boolean;
922
909
  loading?: boolean;
923
910
  emptyText?: string;
924
- icon?: React$1.ComponentType<{
925
- className?: string;
926
- }>;
927
911
  hideError?: boolean;
928
- selectSize?: 'sm' | 'default' | 'lg';
929
- /** Render as dropdown (default) or visual card grid */
930
- variant?: 'default' | 'card';
912
+ /** Enable search input in dropdown */
913
+ searchable?: boolean;
931
914
  /** Server-side search callback. If not provided, filters locally */
932
915
  onSearch?: (query: string) => void;
933
916
  /** Infinite scroll: callback to load more items */
@@ -936,6 +919,25 @@ interface FormSelectProps<T extends FieldValues = FieldValues> extends BaseField
936
919
  hasMore?: boolean;
937
920
  /** Placeholder for the search input */
938
921
  searchPlaceholder?: string;
922
+ /** Dropdown position: 'bottom' (default), 'top', or 'auto' */
923
+ dropdownPosition?: 'bottom' | 'top' | 'auto';
924
+ }
925
+ interface FormMultiSelectProps<T extends FieldValues = FieldValues> extends BaseFieldProps<T> {
926
+ options: SelectOption[];
927
+ placeholder?: string;
928
+ loading?: boolean;
929
+ emptyText?: string;
930
+ hideError?: boolean;
931
+ /** Enable search input in dropdown */
932
+ searchable?: boolean;
933
+ /** Placeholder for the search input */
934
+ searchPlaceholder?: string;
935
+ /** Allow clearing all selected values */
936
+ clearable?: boolean;
937
+ /** Max visible chips before showing "+N" badge (default: 3) */
938
+ maxVisibleChips?: number;
939
+ /** Dropdown position: 'bottom' (default), 'top', or 'auto' */
940
+ dropdownPosition?: 'bottom' | 'top' | 'auto';
939
941
  }
940
942
  interface FormTextareaProps<T extends FieldValues = FieldValues> extends BaseFieldProps<T>, Omit<React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, 'name'> {
941
943
  hideError?: boolean;
@@ -962,16 +964,40 @@ interface FormRadioGroupProps<T extends FieldValues = FieldValues> extends BaseF
962
964
  hideError?: boolean;
963
965
  }
964
966
 
965
- declare function FormInput<T extends FieldValues = FieldValues>({ name, label, description, required, disabled, className, mask, icon, showPasswordToggle, inputSize, hideError, type, maxLength, ...inputProps }: FormInputProps<T>): react_jsx_runtime.JSX.Element;
967
+ interface FormLabelProps extends React$1.LabelHTMLAttributes<HTMLLabelElement> {
968
+ required?: boolean;
969
+ }
970
+ declare const FormLabel: React$1.ForwardRefExoticComponent<FormLabelProps & React$1.RefAttributes<HTMLLabelElement>>;
971
+ interface FormDescriptionProps extends React$1.HTMLAttributes<HTMLParagraphElement> {
972
+ }
973
+ declare const FormDescription: React$1.ForwardRefExoticComponent<FormDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>>;
974
+ interface FormErrorProps extends React$1.HTMLAttributes<HTMLParagraphElement> {
975
+ message?: string;
976
+ }
977
+ declare const FormError: React$1.ForwardRefExoticComponent<FormErrorProps & React$1.RefAttributes<HTMLParagraphElement>>;
978
+ interface FormFieldWrapperProps extends React$1.HTMLAttributes<HTMLDivElement> {
979
+ label?: string;
980
+ description?: string;
981
+ required?: boolean;
982
+ error?: string;
983
+ }
984
+ declare const FormFieldWrapper: React$1.ForwardRefExoticComponent<FormFieldWrapperProps & React$1.RefAttributes<HTMLDivElement>>;
985
+
986
+ declare function FormInput<T extends FieldValues = FieldValues>({ name, label, description, tooltip, required, disabled, className, mask, icon, showPasswordToggle, inputSize, hideError, type, maxLength, ...inputProps }: FormInputProps<T>): react_jsx_runtime.JSX.Element;
966
987
  declare namespace FormInput {
967
988
  var displayName: string;
968
989
  }
969
990
 
970
- declare function FormSelect<T extends FieldValues = FieldValues>({ name, label, description, required, disabled, className, options, placeholder, icon, hideError, selectSize, emptyText, loading, variant, searchable, onSearch, onLoadMore, hasMore, searchPlaceholder, }: FormSelectProps<T>): react_jsx_runtime.JSX.Element;
991
+ declare function FormSelect<T extends FieldValues = FieldValues>({ name, label, description, tooltip, required, disabled, className, options, placeholder, hideError, emptyText, loading, searchable, onSearch, onLoadMore, hasMore, searchPlaceholder, dropdownPosition, }: FormSelectProps<T>): react_jsx_runtime.JSX.Element;
971
992
  declare namespace FormSelect {
972
993
  var displayName: string;
973
994
  }
974
995
 
996
+ declare function FormMultiSelect<T extends FieldValues = FieldValues>({ name, label, description, tooltip, required, disabled, className, options, placeholder, hideError, emptyText, loading, searchable, searchPlaceholder, clearable, maxVisibleChips, dropdownPosition, }: FormMultiSelectProps<T>): react_jsx_runtime.JSX.Element;
997
+ declare namespace FormMultiSelect {
998
+ var displayName: string;
999
+ }
1000
+
975
1001
  declare function FormTextarea<T extends FieldValues = FieldValues>({ name, label, description, required, disabled, className, hideError, showCount, maxLength, ...textareaProps }: FormTextareaProps<T>): react_jsx_runtime.JSX.Element;
976
1002
  declare namespace FormTextarea {
977
1003
  var displayName: string;
@@ -1012,6 +1038,7 @@ declare namespace FormRoot {
1012
1038
  declare const Form: typeof FormRoot & {
1013
1039
  Input: typeof FormInput;
1014
1040
  Select: typeof FormSelect;
1041
+ MultiSelect: typeof FormMultiSelect;
1015
1042
  Textarea: typeof FormTextarea;
1016
1043
  Checkbox: typeof FormCheckbox;
1017
1044
  Switch: typeof FormSwitch;
package/dist/index.d.ts CHANGED
@@ -80,6 +80,8 @@ interface InputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>,
80
80
  label?: string;
81
81
  error?: boolean;
82
82
  icon?: React$1.ComponentType<any>;
83
+ /** Extra ReactNode rendered after label text (used by Form.Input for tooltip icon) */
84
+ labelSuffix?: React$1.ReactNode;
83
85
  containerClassName?: string;
84
86
  labelClassName?: string;
85
87
  }
@@ -858,25 +860,6 @@ interface TextareaProps extends Omit<React$1.TextareaHTMLAttributes<HTMLTextArea
858
860
  }
859
861
  declare const Textarea: React$1.NamedExoticComponent<TextareaProps & React$1.RefAttributes<HTMLTextAreaElement>>;
860
862
 
861
- interface FormLabelProps extends React$1.LabelHTMLAttributes<HTMLLabelElement> {
862
- required?: boolean;
863
- }
864
- declare const FormLabel: React$1.ForwardRefExoticComponent<FormLabelProps & React$1.RefAttributes<HTMLLabelElement>>;
865
- interface FormDescriptionProps extends React$1.HTMLAttributes<HTMLParagraphElement> {
866
- }
867
- declare const FormDescription: React$1.ForwardRefExoticComponent<FormDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>>;
868
- interface FormErrorProps extends React$1.HTMLAttributes<HTMLParagraphElement> {
869
- message?: string;
870
- }
871
- declare const FormError: React$1.ForwardRefExoticComponent<FormErrorProps & React$1.RefAttributes<HTMLParagraphElement>>;
872
- interface FormFieldWrapperProps extends React$1.HTMLAttributes<HTMLDivElement> {
873
- label?: string;
874
- description?: string;
875
- required?: boolean;
876
- error?: string;
877
- }
878
- declare const FormFieldWrapper: React$1.ForwardRefExoticComponent<FormFieldWrapperProps & React$1.RefAttributes<HTMLDivElement>>;
879
-
880
863
  interface FormContextValue<T extends FieldValues = FieldValues> {
881
864
  form: UseFormReturn<T>;
882
865
  }
@@ -886,10 +869,17 @@ interface FormFieldContextValue {
886
869
  error?: string;
887
870
  isRequired?: boolean;
888
871
  }
872
+ interface FieldTooltipConfig {
873
+ title: string;
874
+ description: string;
875
+ }
876
+ type FieldTooltip = string | FieldTooltipConfig;
889
877
  interface BaseFieldProps<T extends FieldValues = FieldValues> {
890
878
  name: FieldPath<T>;
891
879
  label?: string;
892
880
  description?: string;
881
+ /** Tooltip shown via info icon next to the label. String or { title, description } */
882
+ tooltip?: FieldTooltip;
893
883
  required?: boolean;
894
884
  disabled?: boolean;
895
885
  className?: string;
@@ -916,18 +906,11 @@ interface SelectOption {
916
906
  interface FormSelectProps<T extends FieldValues = FieldValues> extends BaseFieldProps<T> {
917
907
  options: SelectOption[];
918
908
  placeholder?: string;
919
- multiple?: boolean;
920
- searchable?: boolean;
921
- clearable?: boolean;
922
909
  loading?: boolean;
923
910
  emptyText?: string;
924
- icon?: React$1.ComponentType<{
925
- className?: string;
926
- }>;
927
911
  hideError?: boolean;
928
- selectSize?: 'sm' | 'default' | 'lg';
929
- /** Render as dropdown (default) or visual card grid */
930
- variant?: 'default' | 'card';
912
+ /** Enable search input in dropdown */
913
+ searchable?: boolean;
931
914
  /** Server-side search callback. If not provided, filters locally */
932
915
  onSearch?: (query: string) => void;
933
916
  /** Infinite scroll: callback to load more items */
@@ -936,6 +919,25 @@ interface FormSelectProps<T extends FieldValues = FieldValues> extends BaseField
936
919
  hasMore?: boolean;
937
920
  /** Placeholder for the search input */
938
921
  searchPlaceholder?: string;
922
+ /** Dropdown position: 'bottom' (default), 'top', or 'auto' */
923
+ dropdownPosition?: 'bottom' | 'top' | 'auto';
924
+ }
925
+ interface FormMultiSelectProps<T extends FieldValues = FieldValues> extends BaseFieldProps<T> {
926
+ options: SelectOption[];
927
+ placeholder?: string;
928
+ loading?: boolean;
929
+ emptyText?: string;
930
+ hideError?: boolean;
931
+ /** Enable search input in dropdown */
932
+ searchable?: boolean;
933
+ /** Placeholder for the search input */
934
+ searchPlaceholder?: string;
935
+ /** Allow clearing all selected values */
936
+ clearable?: boolean;
937
+ /** Max visible chips before showing "+N" badge (default: 3) */
938
+ maxVisibleChips?: number;
939
+ /** Dropdown position: 'bottom' (default), 'top', or 'auto' */
940
+ dropdownPosition?: 'bottom' | 'top' | 'auto';
939
941
  }
940
942
  interface FormTextareaProps<T extends FieldValues = FieldValues> extends BaseFieldProps<T>, Omit<React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, 'name'> {
941
943
  hideError?: boolean;
@@ -962,16 +964,40 @@ interface FormRadioGroupProps<T extends FieldValues = FieldValues> extends BaseF
962
964
  hideError?: boolean;
963
965
  }
964
966
 
965
- declare function FormInput<T extends FieldValues = FieldValues>({ name, label, description, required, disabled, className, mask, icon, showPasswordToggle, inputSize, hideError, type, maxLength, ...inputProps }: FormInputProps<T>): react_jsx_runtime.JSX.Element;
967
+ interface FormLabelProps extends React$1.LabelHTMLAttributes<HTMLLabelElement> {
968
+ required?: boolean;
969
+ }
970
+ declare const FormLabel: React$1.ForwardRefExoticComponent<FormLabelProps & React$1.RefAttributes<HTMLLabelElement>>;
971
+ interface FormDescriptionProps extends React$1.HTMLAttributes<HTMLParagraphElement> {
972
+ }
973
+ declare const FormDescription: React$1.ForwardRefExoticComponent<FormDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>>;
974
+ interface FormErrorProps extends React$1.HTMLAttributes<HTMLParagraphElement> {
975
+ message?: string;
976
+ }
977
+ declare const FormError: React$1.ForwardRefExoticComponent<FormErrorProps & React$1.RefAttributes<HTMLParagraphElement>>;
978
+ interface FormFieldWrapperProps extends React$1.HTMLAttributes<HTMLDivElement> {
979
+ label?: string;
980
+ description?: string;
981
+ required?: boolean;
982
+ error?: string;
983
+ }
984
+ declare const FormFieldWrapper: React$1.ForwardRefExoticComponent<FormFieldWrapperProps & React$1.RefAttributes<HTMLDivElement>>;
985
+
986
+ declare function FormInput<T extends FieldValues = FieldValues>({ name, label, description, tooltip, required, disabled, className, mask, icon, showPasswordToggle, inputSize, hideError, type, maxLength, ...inputProps }: FormInputProps<T>): react_jsx_runtime.JSX.Element;
966
987
  declare namespace FormInput {
967
988
  var displayName: string;
968
989
  }
969
990
 
970
- declare function FormSelect<T extends FieldValues = FieldValues>({ name, label, description, required, disabled, className, options, placeholder, icon, hideError, selectSize, emptyText, loading, variant, searchable, onSearch, onLoadMore, hasMore, searchPlaceholder, }: FormSelectProps<T>): react_jsx_runtime.JSX.Element;
991
+ declare function FormSelect<T extends FieldValues = FieldValues>({ name, label, description, tooltip, required, disabled, className, options, placeholder, hideError, emptyText, loading, searchable, onSearch, onLoadMore, hasMore, searchPlaceholder, dropdownPosition, }: FormSelectProps<T>): react_jsx_runtime.JSX.Element;
971
992
  declare namespace FormSelect {
972
993
  var displayName: string;
973
994
  }
974
995
 
996
+ declare function FormMultiSelect<T extends FieldValues = FieldValues>({ name, label, description, tooltip, required, disabled, className, options, placeholder, hideError, emptyText, loading, searchable, searchPlaceholder, clearable, maxVisibleChips, dropdownPosition, }: FormMultiSelectProps<T>): react_jsx_runtime.JSX.Element;
997
+ declare namespace FormMultiSelect {
998
+ var displayName: string;
999
+ }
1000
+
975
1001
  declare function FormTextarea<T extends FieldValues = FieldValues>({ name, label, description, required, disabled, className, hideError, showCount, maxLength, ...textareaProps }: FormTextareaProps<T>): react_jsx_runtime.JSX.Element;
976
1002
  declare namespace FormTextarea {
977
1003
  var displayName: string;
@@ -1012,6 +1038,7 @@ declare namespace FormRoot {
1012
1038
  declare const Form: typeof FormRoot & {
1013
1039
  Input: typeof FormInput;
1014
1040
  Select: typeof FormSelect;
1041
+ MultiSelect: typeof FormMultiSelect;
1015
1042
  Textarea: typeof FormTextarea;
1016
1043
  Checkbox: typeof FormCheckbox;
1017
1044
  Switch: typeof FormSwitch;