@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 +99 -8
- package/dist/main.js +1 -1
- package/dist/module.js +1 -1
- package/dist-server/index.d.ts +1 -1
- package/dist-server/main.js +1 -1
- package/dist-server/module.js +1 -1
- package/package.json +3 -3
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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.
|
|
141
|
+
export const version = "0.0.38";
|
package/dist/main.js
CHANGED
package/dist/module.js
CHANGED
package/dist-server/index.d.ts
CHANGED
package/dist-server/main.js
CHANGED
|
@@ -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.
|
|
18
|
+
const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.38";
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
function $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b(props) {
|
package/dist-server/module.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/react-ui",
|
|
3
|
-
"version": "0.0.
|
|
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.
|
|
87
|
-
"@depict-ai/utilishared": "^0.0.
|
|
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": {
|