@depict-ai/react-ui 0.0.37 → 0.0.38

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
@@ -4,47 +4,138 @@ import { useNavigate } from "react-router";
4
4
  import { Display } from "@depict-ai/utilishared";
5
5
  import { SDKColsAtSize, SDKGridSpacing } from "@depict-ai/ui";
6
6
  export function DepictSearchField(): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
7
+ /**
8
+ * The props for the DepictProvider.
9
+ */
7
10
  type BaseSearchConfig = {
11
+ /**
12
+ * The market to use for the search.
13
+ * @example "se"
14
+ * @example "no"
15
+ */
8
16
  merchant: string;
17
+ /**
18
+ * The merchant to use for the search.
19
+ * @example "se"
20
+ * @example "no"
21
+ * @example "dk"
22
+ */
9
23
  market: string;
24
+ /**
25
+ * The path to the search page.
26
+ * @example "/search"
27
+ * @example "/sok"
28
+ */
10
29
  searchPagePath: string;
30
+ /**
31
+ * The name of the url parameter that will be used for the search query.
32
+ * @example "q"
33
+ * @example "search_query"
34
+ * @default "search_query"
35
+ */
11
36
  urlParamName?: string;
37
+ /**
38
+ * Whether or not to enable category suggestions.
39
+ * @default false
40
+ */
12
41
  enableCategorySuggestions?: boolean;
13
42
  };
43
+ /**
44
+ *
45
+ If react-router does not exist, useNavigate will fall back to "any".
46
+ In that case, the ReactRouterUseNavigate type becomes "never" and cannot be used.
47
+ */
14
48
  type ReactRouterUseNavigate = any extends typeof useNavigate ? never : typeof useNavigate;
15
- type SearchConfig = BaseSearchConfig | ({
16
- onNavigation: (href: string, shallow?: boolean) => unknown;
17
- reactRouterUseNavigate?: undefined;
18
- } & BaseSearchConfig) | ({
19
- reactRouterUseNavigate: ReactRouterUseNavigate;
20
- onNavigation?: undefined;
21
- } & BaseSearchConfig);
49
+ /**
50
+ * The function that will be called when the user navigates to a new page.
51
+ * @param href - The href of the new page.
52
+ * @param shallow - Whether or not the navigation should be shallow.
53
+ * @returns {unknown}
54
+ */
55
+ type OnNavigation = (href: string, shallow?: boolean) => unknown;
56
+ type SearchConfig = BaseSearchConfig & {
57
+ onNavigation?: OnNavigation;
58
+ reactRouterUseNavigate?: ReactRouterUseNavigate;
59
+ };
60
+ /**
61
+ * The DepictProvider is a wrapper component that should be used to wrap your entire application.
62
+ * @param props - The props for the DepictProvider.
63
+ * @returns {JSX.Element}
64
+ */
22
65
  export function DepictProvider(props: PropsWithChildren<SearchConfig>): import("react").FunctionComponentElement<{
23
66
  children?: import("react").ReactNode;
24
67
  }>;
68
+ /**
69
+ * A search header alignment component.
70
+ * @returns {JSX.Element}
71
+ */
25
72
  export function DepictSearchHeader(): import("react").DetailedReactHTMLElement<{
26
73
  className: string;
27
74
  ref: (e: HTMLElement | null) => HTMLElement | null;
28
75
  }, HTMLElement>;
76
+ /**
77
+ * Opens the search modal.
78
+ * @returns {void}
79
+ */
29
80
  export function openModal(): void;
81
+ /**
82
+ * The Depict product card props.
83
+ */
30
84
  export interface DepictProductCardProps<T extends Display> {
31
85
  display: T | null;
32
86
  }
87
+ /**
88
+ * Depict product card
89
+ */
33
90
  export type DepictProductCard<T extends Display> = (props: DepictProductCardProps<T>) => ReactNode;
34
91
  interface SearchPageConfig<T extends Display> {
92
+ /**
93
+ * The product card to use for rendering products.
94
+ */
35
95
  productCard: DepictProductCard<T>;
96
+ /**
97
+ * How many columns to show at each media size.
98
+ * @default { [[4], [3, 1024], [2, 901]] }
99
+ */
36
100
  columnsAtSize?: SDKColsAtSize;
101
+ /**
102
+ * The spacing between products.
103
+ */
37
104
  gridSpacing?: SDKGridSpacing;
105
+ /**
106
+ * Whether or not to show the search input field.
107
+ * @default true
108
+ */
38
109
  includeInputField?: boolean;
39
110
  }
111
+ /**
112
+ * DepictSearchPage is a component that renders a search page.
113
+ * @param opts
114
+ * @returns {JSX.Element}
115
+ */
40
116
  export function DepictSearchPage<T extends Display>(opts: SearchPageConfig<T>): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
117
+ /**
118
+ * Props for the ImagePlaceholder component
119
+ */
41
120
  interface ImagePlaceholderProps {
121
+ /** The aspect ratio of the image */
42
122
  aspectRatio: number;
43
123
  }
124
+ /**
125
+ * A placeholder image that can be used in place of an image that is loading
126
+ * @param props
127
+ * @returns
128
+ */
44
129
  export const ImagePlaceholder: React.FC<ImagePlaceholderProps>;
130
+ /**
131
+ * Props for the TextPlaceholder component
132
+ */
45
133
  interface TextPlaceholderProps {
134
+ /** The height of the text */
46
135
  height: string;
136
+ /** The width of the text */
47
137
  width: string;
48
138
  }
139
+ /** A placeholder text that can be used in place of a text that is loading */
49
140
  export const TextPlaceholder: React.FC<TextPlaceholderProps>;
50
- export const version = "0.0.37";
141
+ export const version = "0.0.38";
package/dist/main.js CHANGED
@@ -351,7 +351,7 @@ const $afce04c26b0c4208$export$89c6019e4baa40b1 = ({ width: width , height: heig
351
351
  };
352
352
 
353
353
 
354
- const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.37";
354
+ const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.38";
355
355
 
356
356
 
357
357
 
package/dist/module.js CHANGED
@@ -339,7 +339,7 @@ const $8aa3ab31237c8dc9$export$89c6019e4baa40b1 = ({ width: width , height: heig
339
339
  };
340
340
 
341
341
 
342
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.37";
342
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.38";
343
343
 
344
344
 
345
345
 
@@ -1,4 +1,4 @@
1
- export const version = "0.0.37";
1
+ export const version = "0.0.38";
2
2
  export function DepictProvider(props: any): any;
3
3
  export function DepictSearchField(): any;
4
4
  export function DepictSearchPage(): any;
@@ -15,7 +15,7 @@ $parcel$export(module.exports, "openModal", () => $41e7e5d85b5e0d49$export$a7f6c
15
15
  $parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fbfd8236492);
16
16
 
17
17
 
18
- const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.37";
18
+ const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.38";
19
19
 
20
20
 
21
21
  function $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b(props) {
@@ -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.37";
6
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.38";
7
7
 
8
8
 
9
9
  function $2b1fdeb83610500f$export$9fac37a9c21c2f3b(props) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/react-ui",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main.js",
@@ -83,8 +83,8 @@
83
83
  "/dist-server"
84
84
  ],
85
85
  "dependencies": {
86
- "@depict-ai/ui": "^0.0.15",
87
- "@depict-ai/utilishared": "^0.0.13",
86
+ "@depict-ai/ui": "^0.0.16",
87
+ "@depict-ai/utilishared": "^0.0.14",
88
88
  "solid-js": "^1.6.2"
89
89
  },
90
90
  "peerDependencies": {