@depict-ai/react-ui 0.0.62 → 0.0.64

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.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { SDKColsAtSize, SDKGridSpacing } from "@depict-ai/ui/dist";
2
2
  import { Display } from "../../../lib/displays/Display";
3
- import React, { ReactNode, PropsWithChildren } from "react";
3
+ import React, { ReactNode, PropsWithChildren, ReactElement } from "react";
4
4
  import { Locale } from "@depict-ai/ui/locales";
5
5
  import { Display as _Display1 } from "@depict-ai/utilishared";
6
6
  import { CategoryPage } from "@depict-ai/ui";
@@ -392,16 +392,64 @@ interface UseSearchModalReturn {
392
392
  */
393
393
  export function useDepictSearchModal(params: UseSearchModalParams): UseSearchModalReturn;
394
394
  interface SearchFieldProps {
395
+ /**
396
+ * A reference to the DOM element that the modal should be aligned to.
397
+ *
398
+ * The top of the modal will be aligned to the top of the element.
399
+ *
400
+ * The hight of the search field in the modal will be the same as the height of the element.
401
+ * If not provided, the modal will be aligned to the search field itself.
402
+ */
395
403
  alignerRef?: React.RefObject<HTMLElement>;
396
404
  }
397
405
  interface UseDepictSearchFieldReturn {
398
- DepictSearchField: React.FC;
399
- }
400
- interface SearchFieldProps {
401
- alignerRef?: React.RefObject<HTMLElement>;
406
+ /**
407
+ * A React component that renders the search field.
408
+ */
409
+ DepictSearchField: () => ReactElement;
402
410
  }
411
+ /**
412
+ * Hook used to configure the Depict search field.
413
+ * @example
414
+ * Render a search field that opens a modal aligned to the search field itself:
415
+ * ```tsx
416
+ * import React from "react";
417
+ * import { useDepictSearchField } from "@depict-ai/react-ui";
418
+ *
419
+ * const App = () => {
420
+ * const { DepictSearchField } = useDepictSearchModal();
421
+ *
422
+ * return (
423
+ * <div>
424
+ * <DepictSearchField />
425
+ * </div>
426
+ * );
427
+ * };
428
+ * ```
429
+ * @example
430
+ * Render a search field that opens a modal aligned another DOM element:
431
+ * ```tsx
432
+ * import React from "react";
433
+ * import { useDepictSearchField } from "@depict-ai/react-ui";
434
+ *
435
+ * const App = () => {
436
+ * const alignerRef = useRef(null);
437
+ * const { DepictSearchField } = useDepictSearchModal({
438
+ * alignerRef: ref
439
+ * });
440
+ *
441
+ * return (
442
+ * <div>
443
+ * <div ref={alignerRef} style={{ height: "100px", width: "100px" }} />
444
+ * <DepictSearchField />
445
+ * </div>
446
+ * );
447
+ * };
448
+ * ```
449
+ * @returns {JSX.Element}
450
+ */
403
451
  export const useDepictSearchField: (props: SearchFieldProps) => UseDepictSearchFieldReturn;
404
- export const version = "0.0.62";
452
+ export const version = "0.0.64";
405
453
  /**
406
454
  * Helper function to navigate to a new page depending on the navigation library used.
407
455
  */
package/dist/main.js CHANGED
@@ -497,7 +497,7 @@ const $ca5840628781f899$export$45080d603eda647c = (props)=>{
497
497
 
498
498
 
499
499
 
500
- const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.62";
500
+ const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.64";
501
501
 
502
502
 
503
503
 
package/dist/module.js CHANGED
@@ -479,7 +479,7 @@ const $e3ccaca62718bae4$export$45080d603eda647c = (props)=>{
479
479
 
480
480
 
481
481
 
482
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.62";
482
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.64";
483
483
 
484
484
 
485
485
 
@@ -1,11 +1,15 @@
1
+ import { ReactElement } from "react";
1
2
  type OpenModal = () => void;
2
3
  interface UseSearchModalReturn {
3
4
  open: OpenModal;
4
5
  }
5
6
  interface UseDepictSearchFieldReturn {
6
- DepictSearchField: React.FC;
7
+ /**
8
+ * A React component that renders the search field.
9
+ */
10
+ DepictSearchField: () => ReactElement;
7
11
  }
8
- export const version = "0.0.62";
12
+ export const version = "0.0.64";
9
13
  export function DepictProvider(props: any): any;
10
14
  export function DepictSearchPage(): any;
11
15
  export function DepictCategoryPage(): any;
@@ -19,7 +19,7 @@ $parcel$export(module.exports, "useDepictSearchModal", () => $41e7e5d85b5e0d49$e
19
19
  $parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fbfd8236492);
20
20
 
21
21
 
22
- const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.62";
22
+ const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.64";
23
23
 
24
24
 
25
25
  function $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b(props) {
@@ -65,9 +65,9 @@ function $41e7e5d85b5e0d49$export$89c6019e4baa40b1() {
65
65
  }
66
66
  function $41e7e5d85b5e0d49$export$45080d603eda647c() {
67
67
  return {
68
- DepictSearchField: (0, $5efvh$reactjsxruntime.jsx)("div", {
69
- children: []
70
- })
68
+ DepictSearchField: ()=>(0, $5efvh$reactjsxruntime.jsx)("div", {
69
+ children: []
70
+ })
71
71
  };
72
72
  }
73
73
  function $41e7e5d85b5e0d49$export$a7f6cffb6b8ba11c() {}
@@ -3,7 +3,7 @@ import {jsx as $1RlIW$jsx} from "react/jsx-runtime";
3
3
 
4
4
 
5
5
 
6
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.62";
6
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.64";
7
7
 
8
8
 
9
9
  function $2b1fdeb83610500f$export$9fac37a9c21c2f3b(props) {
@@ -49,9 +49,9 @@ function $2b1fdeb83610500f$export$89c6019e4baa40b1() {
49
49
  }
50
50
  function $2b1fdeb83610500f$export$45080d603eda647c() {
51
51
  return {
52
- DepictSearchField: (0, $1RlIW$jsx)("div", {
53
- children: []
54
- })
52
+ DepictSearchField: ()=>(0, $1RlIW$jsx)("div", {
53
+ children: []
54
+ })
55
55
  };
56
56
  }
57
57
  function $2b1fdeb83610500f$export$a7f6cffb6b8ba11c() {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/react-ui",
3
- "version": "0.0.62",
3
+ "version": "0.0.64",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main.js",
@@ -90,8 +90,8 @@
90
90
  "/locales"
91
91
  ],
92
92
  "dependencies": {
93
- "@depict-ai/ui": "^0.0.39",
94
- "@depict-ai/utilishared": "^0.0.37",
93
+ "@depict-ai/ui": "^0.0.41",
94
+ "@depict-ai/utilishared": "^0.0.39",
95
95
  "solid-js": "^1.6.2"
96
96
  },
97
97
  "peerDependencies": {