@seekho/ui 0.1.9 → 0.1.12

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
@@ -1,6 +1,48 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
3
 
4
+ interface RenderOptionProps {
5
+ onClick: (e: React.MouseEvent<HTMLLIElement>) => void;
6
+ onMouseEnter: () => void;
7
+ className: string;
8
+ }
9
+ interface AutoCompleteProps<T> {
10
+ label?: string;
11
+ value: T | null;
12
+ options: T[];
13
+ disabled?: boolean;
14
+ error?: boolean;
15
+ className?: string;
16
+ getOptionLabel: (option: T) => string;
17
+ isOptionEqualToValue?: (option: T, value: T) => boolean;
18
+ isLoading?: boolean;
19
+ renderOption?: (props: RenderOptionProps, option: T) => React.ReactNode;
20
+ onChange: (value: T | null) => void;
21
+ onInputChange?: (value: string) => void;
22
+ }
23
+ declare function AutoComplete<T>({ label, value, options, disabled, error, className, getOptionLabel, isOptionEqualToValue, isLoading, renderOption, onChange, onInputChange, }: AutoCompleteProps<T>): react_jsx_runtime.JSX.Element;
24
+
25
+ interface ButtonLoaderProps {
26
+ className?: string;
27
+ }
28
+ declare const ButtonLoader: ({ className }: ButtonLoaderProps) => react_jsx_runtime.JSX.Element;
29
+
30
+ interface CopyIdProps {
31
+ id: string | number;
32
+ className?: string;
33
+ displayHash?: boolean;
34
+ onCopy?: (success: boolean) => void;
35
+ }
36
+ declare const CopyId: ({ id, className, displayHash, onCopy, }: CopyIdProps) => react_jsx_runtime.JSX.Element;
37
+
38
+ interface CustomAnchorProps {
39
+ displayText: React.ReactNode;
40
+ href: string;
41
+ className?: string;
42
+ openInNewTab?: boolean;
43
+ }
44
+ declare const CustomAnchor: ({ displayText, href, className, openInNewTab, }: CustomAnchorProps) => react_jsx_runtime.JSX.Element;
45
+
4
46
  interface ModalProps {
5
47
  show: boolean;
6
48
  title?: string;
@@ -21,22 +63,33 @@ interface ReadMoreProps {
21
63
  displayText: string;
22
64
  className?: string;
23
65
  numberOfCharactersToShow?: number;
24
- handleCopyDisplayText?: (args: {
25
- displayText: string;
26
- }) => void;
66
+ showCopy?: boolean;
67
+ onCopy?: (success: boolean) => void;
27
68
  handleToggleReadMore: () => void;
28
69
  }
29
- declare function ReadMore({ readMore, index, displayText, className, numberOfCharactersToShow, handleCopyDisplayText, handleToggleReadMore, }: ReadMoreProps): react_jsx_runtime.JSX.Element;
70
+ declare function ReadMore({ readMore, index, displayText, className, numberOfCharactersToShow, showCopy, onCopy, handleToggleReadMore, }: ReadMoreProps): react_jsx_runtime.JSX.Element;
71
+
72
+ interface SearchBarProps {
73
+ value: string;
74
+ placeHolder?: string;
75
+ wrapperClass?: string;
76
+ className?: string;
77
+ /** Pass the current URL search param value (e.g. from useLocation) to control clear button visibility */
78
+ searchParamQuery?: string;
79
+ onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
80
+ handleInputKey?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
81
+ handleClearInput?: () => void;
82
+ }
83
+ declare function SearchBar({ value, placeHolder, wrapperClass, className, searchParamQuery, onChange, handleInputKey, handleClearInput, }: SearchBarProps): react_jsx_runtime.JSX.Element;
30
84
 
31
85
  /**
32
86
  * useState backed by localStorage — syncs value on mount and persists on change.
33
87
  */
34
88
  declare function useLocalStorage<T>(key: string, initialValue: T): readonly [T, (value: T | ((prev: T) => T)) => void, () => void];
35
89
 
36
- /**
37
- * Merges class names, filtering out falsy values.
38
- * Lightweight alternative to clsx for simple use cases.
39
- */
40
- declare function cn(...classes: (string | undefined | null | false)[]): string;
90
+ declare const cn: (...classes: (string | undefined | null | false)[]) => string;
91
+ declare const handleCopyTextToClipboard: ({ clipboardText, }: {
92
+ clipboardText: string | number | null | undefined;
93
+ }) => Promise<boolean>;
41
94
 
42
- export { Modal, type ModalProps, ReadMore, type ReadMoreProps, cn, useLocalStorage };
95
+ export { AutoComplete, type AutoCompleteProps, ButtonLoader, type ButtonLoaderProps, CopyId, type CopyIdProps, CustomAnchor, type CustomAnchorProps, Modal, type ModalProps, ReadMore, type ReadMoreProps, SearchBar, type SearchBarProps, cn, handleCopyTextToClipboard, useLocalStorage };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,48 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
3
 
4
+ interface RenderOptionProps {
5
+ onClick: (e: React.MouseEvent<HTMLLIElement>) => void;
6
+ onMouseEnter: () => void;
7
+ className: string;
8
+ }
9
+ interface AutoCompleteProps<T> {
10
+ label?: string;
11
+ value: T | null;
12
+ options: T[];
13
+ disabled?: boolean;
14
+ error?: boolean;
15
+ className?: string;
16
+ getOptionLabel: (option: T) => string;
17
+ isOptionEqualToValue?: (option: T, value: T) => boolean;
18
+ isLoading?: boolean;
19
+ renderOption?: (props: RenderOptionProps, option: T) => React.ReactNode;
20
+ onChange: (value: T | null) => void;
21
+ onInputChange?: (value: string) => void;
22
+ }
23
+ declare function AutoComplete<T>({ label, value, options, disabled, error, className, getOptionLabel, isOptionEqualToValue, isLoading, renderOption, onChange, onInputChange, }: AutoCompleteProps<T>): react_jsx_runtime.JSX.Element;
24
+
25
+ interface ButtonLoaderProps {
26
+ className?: string;
27
+ }
28
+ declare const ButtonLoader: ({ className }: ButtonLoaderProps) => react_jsx_runtime.JSX.Element;
29
+
30
+ interface CopyIdProps {
31
+ id: string | number;
32
+ className?: string;
33
+ displayHash?: boolean;
34
+ onCopy?: (success: boolean) => void;
35
+ }
36
+ declare const CopyId: ({ id, className, displayHash, onCopy, }: CopyIdProps) => react_jsx_runtime.JSX.Element;
37
+
38
+ interface CustomAnchorProps {
39
+ displayText: React.ReactNode;
40
+ href: string;
41
+ className?: string;
42
+ openInNewTab?: boolean;
43
+ }
44
+ declare const CustomAnchor: ({ displayText, href, className, openInNewTab, }: CustomAnchorProps) => react_jsx_runtime.JSX.Element;
45
+
4
46
  interface ModalProps {
5
47
  show: boolean;
6
48
  title?: string;
@@ -21,22 +63,33 @@ interface ReadMoreProps {
21
63
  displayText: string;
22
64
  className?: string;
23
65
  numberOfCharactersToShow?: number;
24
- handleCopyDisplayText?: (args: {
25
- displayText: string;
26
- }) => void;
66
+ showCopy?: boolean;
67
+ onCopy?: (success: boolean) => void;
27
68
  handleToggleReadMore: () => void;
28
69
  }
29
- declare function ReadMore({ readMore, index, displayText, className, numberOfCharactersToShow, handleCopyDisplayText, handleToggleReadMore, }: ReadMoreProps): react_jsx_runtime.JSX.Element;
70
+ declare function ReadMore({ readMore, index, displayText, className, numberOfCharactersToShow, showCopy, onCopy, handleToggleReadMore, }: ReadMoreProps): react_jsx_runtime.JSX.Element;
71
+
72
+ interface SearchBarProps {
73
+ value: string;
74
+ placeHolder?: string;
75
+ wrapperClass?: string;
76
+ className?: string;
77
+ /** Pass the current URL search param value (e.g. from useLocation) to control clear button visibility */
78
+ searchParamQuery?: string;
79
+ onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
80
+ handleInputKey?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
81
+ handleClearInput?: () => void;
82
+ }
83
+ declare function SearchBar({ value, placeHolder, wrapperClass, className, searchParamQuery, onChange, handleInputKey, handleClearInput, }: SearchBarProps): react_jsx_runtime.JSX.Element;
30
84
 
31
85
  /**
32
86
  * useState backed by localStorage — syncs value on mount and persists on change.
33
87
  */
34
88
  declare function useLocalStorage<T>(key: string, initialValue: T): readonly [T, (value: T | ((prev: T) => T)) => void, () => void];
35
89
 
36
- /**
37
- * Merges class names, filtering out falsy values.
38
- * Lightweight alternative to clsx for simple use cases.
39
- */
40
- declare function cn(...classes: (string | undefined | null | false)[]): string;
90
+ declare const cn: (...classes: (string | undefined | null | false)[]) => string;
91
+ declare const handleCopyTextToClipboard: ({ clipboardText, }: {
92
+ clipboardText: string | number | null | undefined;
93
+ }) => Promise<boolean>;
41
94
 
42
- export { Modal, type ModalProps, ReadMore, type ReadMoreProps, cn, useLocalStorage };
95
+ export { AutoComplete, type AutoCompleteProps, ButtonLoader, type ButtonLoaderProps, CopyId, type CopyIdProps, CustomAnchor, type CustomAnchorProps, Modal, type ModalProps, ReadMore, type ReadMoreProps, SearchBar, type SearchBarProps, cn, handleCopyTextToClipboard, useLocalStorage };