@sudobility/components 5.0.12 → 5.0.14
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/hooks/useClickOutside.d.ts +10 -0
- package/dist/hooks/useClickOutside.d.ts.map +1 -1
- package/dist/hooks/useCodeLoader.d.ts +13 -0
- package/dist/hooks/useCodeLoader.d.ts.map +1 -1
- package/dist/index.esm.js +3022 -2992
- package/dist/index.umd.js +13 -13
- package/dist/lib/utils.d.ts +10 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/platforms/web.d.ts +5 -1
- package/dist/platforms/web.d.ts.map +1 -1
- package/dist/ui/button.d.ts +22 -1
- package/dist/ui/button.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Hook that detects clicks outside of a referenced element.
|
|
4
|
+
*
|
|
5
|
+
* Attaches mousedown and touchstart event listeners to the document
|
|
6
|
+
* and calls the handler when a click occurs outside the referenced element.
|
|
7
|
+
* Useful for closing dropdowns, modals, or popovers when clicking outside.
|
|
8
|
+
*
|
|
9
|
+
* @param ref - React ref object pointing to the element to monitor
|
|
10
|
+
* @param handler - Callback invoked when a click outside the element is detected
|
|
11
|
+
*/
|
|
2
12
|
export declare function useClickOutside<T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: (event: Event) => void): void;
|
|
3
13
|
//# sourceMappingURL=useClickOutside.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClickOutside.d.ts","sourceRoot":"","sources":["../../src/hooks/useClickOutside.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7C,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EACjE,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,EACjB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,QAmBhC"}
|
|
1
|
+
{"version":3,"file":"useClickOutside.d.ts","sourceRoot":"","sources":["../../src/hooks/useClickOutside.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7C;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EACjE,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,EACjB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,QAmBhC"}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
+
/** Return type for the useCodeLoader hook. */
|
|
1
2
|
interface UseCodeLoaderReturn {
|
|
3
|
+
/** The loaded code content, or an error placeholder string. */
|
|
2
4
|
code: string;
|
|
5
|
+
/** Whether the code file is currently being fetched. */
|
|
3
6
|
loading: boolean;
|
|
7
|
+
/** Error message if the fetch failed, or null on success. */
|
|
4
8
|
error: string | null;
|
|
5
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Hook that fetches a code file from the `/code/` endpoint.
|
|
12
|
+
*
|
|
13
|
+
* Loads a code file by filename, managing loading and error states.
|
|
14
|
+
* The file is fetched from `/code/{filename}` and returned as a string.
|
|
15
|
+
*
|
|
16
|
+
* @param filename - The name of the code file to fetch
|
|
17
|
+
* @returns An object containing the code content, loading state, and any error
|
|
18
|
+
*/
|
|
6
19
|
export declare const useCodeLoader: (filename: string) => UseCodeLoaderReturn;
|
|
7
20
|
export {};
|
|
8
21
|
//# sourceMappingURL=useCodeLoader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCodeLoader.d.ts","sourceRoot":"","sources":["../../src/hooks/useCodeLoader.ts"],"names":[],"mappings":"AAEA,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,KAAG,mBAiChD,CAAC"}
|
|
1
|
+
{"version":3,"file":"useCodeLoader.d.ts","sourceRoot":"","sources":["../../src/hooks/useCodeLoader.ts"],"names":[],"mappings":"AAEA,8CAA8C;AAC9C,UAAU,mBAAmB;IAC3B,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,OAAO,EAAE,OAAO,CAAC;IACjB,6DAA6D;IAC7D,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,KAAG,mBAiChD,CAAC"}
|