@me1a/ui 2.2.11 → 2.5.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
@@ -733,27 +733,27 @@ type ResizableHandleProps = ComponentProps<typeof ResizablePrimitive.PanelResize
733
733
  withHandle?: boolean;
734
734
  };
735
735
 
736
- type SelectOption = {
737
- id: string;
736
+ type SelectOption<T extends string | number = string | number> = {
737
+ id: T;
738
738
  label: string;
739
739
  startIcon?: React$1.ReactNode;
740
740
  endIcon?: React$1.ReactNode;
741
741
  className?: string;
742
742
  disabled?: boolean;
743
743
  };
744
- type SelectProps = {
744
+ type SelectProps<T extends string | number = string | number> = {
745
745
  /** Whether the select is searchable */
746
746
  searchable?: boolean;
747
747
  /** Whether the select should take up the full width of its container */
748
748
  fullWidth?: boolean;
749
749
  /** Currently selected value */
750
- value: string;
750
+ value: T;
751
751
  /** Array of options to display in the select */
752
- options: SelectOption[];
752
+ options: SelectOption<T>[];
753
753
  /** Callback fired when the value changes */
754
- onChange: (value: string) => void;
754
+ onChange: (value: T) => void;
755
755
  /** Render a custom CommandList for the select, if not provided, the select will render a default CommandList with the options */
756
- renderCommandList?: (options: SelectOption[]) => React$1.ReactNode;
756
+ renderCommandList?: (options: SelectOption<T>[]) => React$1.ReactNode;
757
757
  /** Placeholder text to show when no value is selected */
758
758
  placeholder?: string;
759
759
  /** Whether the select is disabled */
@@ -786,7 +786,7 @@ type SelectProps = {
786
786
  * />
787
787
  * ```
788
788
  */
789
- declare function Select({ options, value, onChange, placeholder, disabled, required, error, className, fullWidth, searchable, id, renderCommandList }: SelectProps): react_jsx_runtime.JSX.Element;
789
+ declare function Select<T extends string | number = string | number>({ options, value, onChange, placeholder, disabled, required, error, className, fullWidth, searchable, id, renderCommandList }: SelectProps<T>): react_jsx_runtime.JSX.Element;
790
790
 
791
791
  type MultiSelectOption = {
792
792
  id: string;