@trackunit/react-components 0.1.67 → 0.1.69
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/index.cjs +272 -192
- package/index.css +23 -24
- package/index.js +270 -192
- package/package.json +2 -2
- package/src/components/FormGroup/FormGroup.d.ts +2 -1
- package/src/hooks/index.d.ts +2 -0
- package/src/hooks/useClickOutside.d.ts +12 -0
- package/src/hooks/useResize.d.ts +10 -0
|
@@ -9,6 +9,7 @@ export interface FormGroupProps extends CommonProps {
|
|
|
9
9
|
* Content to display in the tooltip when hovering the ? icon next to the label.
|
|
10
10
|
*/
|
|
11
11
|
tip?: string | React.ReactNode;
|
|
12
|
+
htmlFor?: string;
|
|
12
13
|
/**
|
|
13
14
|
* A string to display under the input element to help the user understand the input.
|
|
14
15
|
*/
|
|
@@ -35,4 +36,4 @@ export interface FormGroupProps extends CommonProps {
|
|
|
35
36
|
* @param {FormGroupProps} props - The props for the FormGroup component
|
|
36
37
|
* @returns {JSX.Element} FormGroup component
|
|
37
38
|
*/
|
|
38
|
-
export declare const FormGroup: ({ isInvalid, helpText, helpAddon, tip, className, dataTestId, label, children, disabled, }: FormGroupProps) => JSX.Element;
|
|
39
|
+
export declare const FormGroup: ({ isInvalid, helpText, helpAddon, tip, className, dataTestId, label, htmlFor, children, disabled, }: FormGroupProps) => JSX.Element;
|
package/src/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook to handle click outside events.
|
|
4
|
+
*
|
|
5
|
+
* @param {RefObject<HTMLElement> | Array<RefObject<HTMLElement>>} el - The reference(s) to the element(s) to watch for click outside events.
|
|
6
|
+
* @param {Object | Function} [options={}] - Configuration options or the click event handler if options are not provided.
|
|
7
|
+
* @param {boolean} [options.active=true] - Whether the click outside event listener should be active.
|
|
8
|
+
* @param {Function} [onClick] - The event handler for the click outside event.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useClickOutside: (el: RefObject<HTMLElement> | RefObject<HTMLElement>[], options?: {
|
|
11
|
+
active?: boolean | undefined;
|
|
12
|
+
} | ((ev: MouseEvent) => void), onClick?: ((ev: MouseEvent) => void) | undefined) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface WindowSize {
|
|
2
|
+
height: number;
|
|
3
|
+
width: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Custom hook to handle window resize events and provide the current window size.
|
|
7
|
+
*
|
|
8
|
+
* @returns {WindowSize} An object containing the current window height and width.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useResize: () => WindowSize;
|