@seekora-ai/ui-sdk-react 0.2.9 → 0.2.10
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/components/suggestions-primitives/SuggestionItem.d.ts +15 -2
- package/dist/components/suggestions-primitives/SuggestionItem.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/SuggestionItem.js +11 -3
- package/dist/components/suggestions-primitives/SuggestionList.d.ts +13 -2
- package/dist/components/suggestions-primitives/SuggestionList.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/SuggestionList.js +5 -3
- package/dist/components/suggestions-primitives/highlightMarkup.d.ts +19 -0
- package/dist/components/suggestions-primitives/highlightMarkup.d.ts.map +1 -0
- package/dist/components/suggestions-primitives/highlightMarkup.js +32 -0
- package/dist/components/suggestions-primitives/index.d.ts +2 -0
- package/dist/components/suggestions-primitives/index.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/index.js +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/src/index.d.ts +44 -5
- package/dist/src/index.esm.js +48 -7
- package/dist/src/index.esm.js.map +1 -1
- package/dist/src/index.js +48 -6
- package/dist/src/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SuggestionItem – single text suggestion row (primitive)
|
|
3
3
|
*
|
|
4
|
-
* Highlights when isActive; onClick calls context selectSuggestion.
|
|
4
|
+
* Highlights when isActive; onClick calls context selectSuggestion.
|
|
5
|
+
* When enableHighlightMarkup is true (default), parses <mark>...</mark> in
|
|
6
|
+
* suggestion text and renders as highlighted <mark> elements. Overridable via
|
|
7
|
+
* renderHighlight, className/style.
|
|
5
8
|
*/
|
|
6
9
|
import React from 'react';
|
|
7
10
|
import type { SuggestionItem as SuggestionItemType } from '@seekora-ai/ui-sdk-types';
|
|
11
|
+
import type { HighlightMarkupOptions } from './highlightMarkup';
|
|
8
12
|
export interface SuggestionItemProps {
|
|
9
13
|
suggestion: SuggestionItemType;
|
|
10
14
|
index: number;
|
|
@@ -12,7 +16,16 @@ export interface SuggestionItemProps {
|
|
|
12
16
|
onSelect: () => void;
|
|
13
17
|
className?: string;
|
|
14
18
|
style?: React.CSSProperties;
|
|
19
|
+
/**
|
|
20
|
+
* When true (default), text containing <mark>...</mark> is rendered with
|
|
21
|
+
* those segments as highlighted <mark> elements. When false, plain query
|
|
22
|
+
* text is shown with no markup parsing.
|
|
23
|
+
*/
|
|
24
|
+
enableHighlightMarkup?: boolean;
|
|
25
|
+
/** Options for the default highlight <mark> styling when enableHighlightMarkup is true. */
|
|
26
|
+
highlightMarkupOptions?: HighlightMarkupOptions;
|
|
27
|
+
/** Custom renderer for suggestion text; overrides default highlight parsing when provided. */
|
|
15
28
|
renderHighlight?: (text: string) => React.ReactNode;
|
|
16
29
|
}
|
|
17
|
-
export declare function SuggestionItem({ suggestion, index, isActive, onSelect, className, style, renderHighlight, }: SuggestionItemProps): React.JSX.Element;
|
|
30
|
+
export declare function SuggestionItem({ suggestion, index, isActive, onSelect, className, style, enableHighlightMarkup, highlightMarkupOptions, renderHighlight, }: SuggestionItemProps): React.JSX.Element;
|
|
18
31
|
//# sourceMappingURL=SuggestionItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuggestionItem.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions-primitives/SuggestionItem.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SuggestionItem.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions-primitives/SuggestionItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAErF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEhE,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,kBAAkB,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,2FAA2F;IAC3F,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAChD,8FAA8F;IAC9F,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;CACrD;AAgBD,wBAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,KAAK,EACL,qBAA4B,EAC5B,sBAAsB,EACtB,eAAe,GAChB,EAAE,mBAAmB,qBAoCrB"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SuggestionItem – single text suggestion row (primitive)
|
|
3
3
|
*
|
|
4
|
-
* Highlights when isActive; onClick calls context selectSuggestion.
|
|
4
|
+
* Highlights when isActive; onClick calls context selectSuggestion.
|
|
5
|
+
* When enableHighlightMarkup is true (default), parses <mark>...</mark> in
|
|
6
|
+
* suggestion text and renders as highlighted <mark> elements. Overridable via
|
|
7
|
+
* renderHighlight, className/style.
|
|
5
8
|
*/
|
|
6
9
|
import React from 'react';
|
|
7
10
|
import { clsx } from 'clsx';
|
|
11
|
+
import { parseHighlightMarkup } from './highlightMarkup';
|
|
8
12
|
const defaultItemStyle = {
|
|
9
13
|
padding: '10px 12px',
|
|
10
14
|
cursor: 'pointer',
|
|
@@ -18,9 +22,13 @@ const defaultItemStyle = {
|
|
|
18
22
|
color: 'var(--seekora-text-primary, #111827)',
|
|
19
23
|
transition: 'background-color 120ms ease',
|
|
20
24
|
};
|
|
21
|
-
export function SuggestionItem({ suggestion, index, isActive, onSelect, className, style, renderHighlight, }) {
|
|
25
|
+
export function SuggestionItem({ suggestion, index, isActive, onSelect, className, style, enableHighlightMarkup = true, highlightMarkupOptions, renderHighlight, }) {
|
|
22
26
|
const displayText = suggestion.highlightedQuery ?? suggestion.query;
|
|
23
|
-
const content = renderHighlight
|
|
27
|
+
const content = renderHighlight != null
|
|
28
|
+
? renderHighlight(displayText)
|
|
29
|
+
: enableHighlightMarkup
|
|
30
|
+
? parseHighlightMarkup(displayText ?? '', highlightMarkupOptions)
|
|
31
|
+
: (suggestion.query ?? displayText ?? '');
|
|
24
32
|
return (React.createElement("li", { role: "option", "aria-selected": isActive, id: `seekora-suggestion-${index}`, className: clsx('seekora-suggestions-item', isActive && 'seekora-suggestions-item--active', className), style: {
|
|
25
33
|
...defaultItemStyle,
|
|
26
34
|
...(isActive ? { backgroundColor: 'var(--seekora-bg-hover, #f3f4f6)' } : {}),
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SuggestionList – container for text suggestions (primitive)
|
|
3
3
|
*
|
|
4
|
-
* Renders list of SuggestionItem from context; uses activeIndex for highlight.
|
|
4
|
+
* Renders list of SuggestionItem from context; uses activeIndex for highlight.
|
|
5
|
+
* Optional renderItem. When not using renderItem, enableHighlightMarkup and
|
|
6
|
+
* highlightMarkupOptions control parsing of <mark>...</mark> in suggestion text.
|
|
5
7
|
*/
|
|
6
8
|
import React from 'react';
|
|
9
|
+
import type { HighlightMarkupOptions } from './highlightMarkup';
|
|
7
10
|
export interface SuggestionListProps {
|
|
8
11
|
maxItems?: number;
|
|
9
12
|
className?: string;
|
|
10
13
|
style?: React.CSSProperties;
|
|
11
14
|
listClassName?: string;
|
|
15
|
+
/**
|
|
16
|
+
* When true (default), suggestion text with <mark>...</mark> is rendered
|
|
17
|
+
* with those segments highlighted. When false, plain text is shown.
|
|
18
|
+
* Only applies when not using custom renderItem.
|
|
19
|
+
*/
|
|
20
|
+
enableHighlightMarkup?: boolean;
|
|
21
|
+
/** Options for default highlight <mark> styling. Only applies when not using custom renderItem. */
|
|
22
|
+
highlightMarkupOptions?: HighlightMarkupOptions;
|
|
12
23
|
renderItem?: (suggestion: import('@seekora-ai/ui-sdk-types').SuggestionItem, index: number, isActive: boolean, onSelect: () => void) => React.ReactNode;
|
|
13
24
|
}
|
|
14
|
-
export declare function SuggestionList({ maxItems, className, style, listClassName, renderItem, }: SuggestionListProps): React.JSX.Element | null;
|
|
25
|
+
export declare function SuggestionList({ maxItems, className, style, listClassName, enableHighlightMarkup, highlightMarkupOptions, renderItem, }: SuggestionListProps): React.JSX.Element | null;
|
|
15
26
|
//# sourceMappingURL=SuggestionList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuggestionList.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions-primitives/SuggestionList.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SuggestionList.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions-primitives/SuggestionList.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEhE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,mGAAmG;IACnG,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAChD,UAAU,CAAC,EAAE,CACX,UAAU,EAAE,OAAO,0BAA0B,EAAE,cAAc,EAC7D,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,MAAM,IAAI,KACjB,KAAK,CAAC,SAAS,CAAC;CACtB;AAOD,wBAAgB,cAAc,CAAC,EAC7B,QAAa,EACb,SAAS,EACT,KAAK,EACL,aAAa,EACb,qBAA4B,EAC5B,sBAAsB,EACtB,UAAU,GACX,EAAE,mBAAmB,4BAiDrB"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SuggestionList – container for text suggestions (primitive)
|
|
3
3
|
*
|
|
4
|
-
* Renders list of SuggestionItem from context; uses activeIndex for highlight.
|
|
4
|
+
* Renders list of SuggestionItem from context; uses activeIndex for highlight.
|
|
5
|
+
* Optional renderItem. When not using renderItem, enableHighlightMarkup and
|
|
6
|
+
* highlightMarkupOptions control parsing of <mark>...</mark> in suggestion text.
|
|
5
7
|
*/
|
|
6
8
|
import React from 'react';
|
|
7
9
|
import { useSuggestionsContext } from './SuggestionsContext';
|
|
@@ -12,7 +14,7 @@ const listStyle = {
|
|
|
12
14
|
margin: 0,
|
|
13
15
|
padding: '4px 0',
|
|
14
16
|
};
|
|
15
|
-
export function SuggestionList({ maxItems = 10, className, style, listClassName, renderItem, }) {
|
|
17
|
+
export function SuggestionList({ maxItems = 10, className, style, listClassName, enableHighlightMarkup = true, highlightMarkupOptions, renderItem, }) {
|
|
16
18
|
const { suggestions, activeIndex, loading, selectSuggestion, getAllNavigableItems, } = useSuggestionsContext();
|
|
17
19
|
const items = suggestions.slice(0, maxItems);
|
|
18
20
|
const navigableItems = getAllNavigableItems();
|
|
@@ -31,6 +33,6 @@ export function SuggestionList({ maxItems = 10, className, style, listClassName,
|
|
|
31
33
|
if (renderItem) {
|
|
32
34
|
return (React.createElement("li", { key: suggestion.objectID ?? suggestion.query ?? i, role: "option" }, renderItem(suggestion, globalIndex, isActive, onSelect)));
|
|
33
35
|
}
|
|
34
|
-
return (React.createElement(SuggestionItem, { key: suggestion.objectID ?? suggestion.query ?? i, suggestion: suggestion, index: globalIndex, isActive: isActive, onSelect: onSelect }));
|
|
36
|
+
return (React.createElement(SuggestionItem, { key: suggestion.objectID ?? suggestion.query ?? i, suggestion: suggestion, index: globalIndex, isActive: isActive, onSelect: onSelect, enableHighlightMarkup: enableHighlightMarkup, highlightMarkupOptions: highlightMarkupOptions }));
|
|
35
37
|
}))));
|
|
36
38
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses suggestion text containing <mark>...</mark> and returns React nodes
|
|
3
|
+
* with the marked segments rendered as <mark> elements. Safe: inner content
|
|
4
|
+
* is rendered as text, not HTML.
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
export interface HighlightMarkupOptions {
|
|
8
|
+
/** Class name for the <mark> element. */
|
|
9
|
+
markClassName?: string;
|
|
10
|
+
/** Inline style for the <mark> element. */
|
|
11
|
+
markStyle?: React.CSSProperties;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Converts a string like "lined <mark>blue</mark>" into React nodes with
|
|
15
|
+
* the marked part rendered as a <mark> element. When no <mark> tags are
|
|
16
|
+
* present, returns the string as-is.
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseHighlightMarkup(text: string, options?: HighlightMarkupOptions): React.ReactNode;
|
|
19
|
+
//# sourceMappingURL=highlightMarkup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlightMarkup.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions-primitives/highlightMarkup.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACjC;AASD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,sBAA2B,GACnC,KAAK,CAAC,SAAS,CAyBjB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses suggestion text containing <mark>...</mark> and returns React nodes
|
|
3
|
+
* with the marked segments rendered as <mark> elements. Safe: inner content
|
|
4
|
+
* is rendered as text, not HTML.
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
const defaultMarkStyle = {
|
|
8
|
+
backgroundColor: 'var(--seekora-highlight-bg, rgba(251, 191, 36, 0.4))',
|
|
9
|
+
fontWeight: 500,
|
|
10
|
+
borderRadius: '2px',
|
|
11
|
+
padding: '0 2px',
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Converts a string like "lined <mark>blue</mark>" into React nodes with
|
|
15
|
+
* the marked part rendered as a <mark> element. When no <mark> tags are
|
|
16
|
+
* present, returns the string as-is.
|
|
17
|
+
*/
|
|
18
|
+
export function parseHighlightMarkup(text, options = {}) {
|
|
19
|
+
if (text == null || typeof text !== 'string')
|
|
20
|
+
return text;
|
|
21
|
+
const parts = text.split(/(<mark>[\s\S]*?<\/mark>)/g);
|
|
22
|
+
if (parts.length <= 1)
|
|
23
|
+
return text;
|
|
24
|
+
const { markClassName, markStyle } = options;
|
|
25
|
+
return (React.createElement(React.Fragment, null, parts.map((part, i) => {
|
|
26
|
+
const m = part.match(/^<mark>([\s\S]*)<\/mark>$/);
|
|
27
|
+
if (m) {
|
|
28
|
+
return (React.createElement("mark", { key: i, className: markClassName, style: { ...defaultMarkStyle, ...markStyle } }, m[1]));
|
|
29
|
+
}
|
|
30
|
+
return part;
|
|
31
|
+
})));
|
|
32
|
+
}
|
|
@@ -18,6 +18,8 @@ export { SuggestionList } from './SuggestionList';
|
|
|
18
18
|
export type { SuggestionListProps } from './SuggestionList';
|
|
19
19
|
export { SuggestionItem } from './SuggestionItem';
|
|
20
20
|
export type { SuggestionItemProps } from './SuggestionItem';
|
|
21
|
+
export { parseHighlightMarkup } from './highlightMarkup';
|
|
22
|
+
export type { HighlightMarkupOptions } from './highlightMarkup';
|
|
21
23
|
export { ItemCard, type GenericItem, type ItemCardProps, type ImageDisplayVariant as ItemCardImageVariant } from './ItemCard';
|
|
22
24
|
export { ItemGrid, type ItemGridProps } from './ItemGrid';
|
|
23
25
|
export { ProductCard } from './ProductCard';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions-primitives/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACjF,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/suggestions-primitives/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACjF,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uB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AAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,YAAY,EAAE,mCAAmC,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -12,6 +12,7 @@ export { SearchInput } from './SearchInput';
|
|
|
12
12
|
export { DropdownPanel } from './DropdownPanel';
|
|
13
13
|
export { SuggestionList } from './SuggestionList';
|
|
14
14
|
export { SuggestionItem } from './SuggestionItem';
|
|
15
|
+
export { parseHighlightMarkup } from './highlightMarkup';
|
|
15
16
|
export { ItemCard } from './ItemCard';
|
|
16
17
|
export { ItemGrid } from './ItemGrid';
|
|
17
18
|
export { ProductCard } from './ProductCard';
|
package/dist/index.d.ts
CHANGED
|
@@ -27,8 +27,8 @@ export { QuerySuggestionsDropdown } from './components/QuerySuggestionsDropdown'
|
|
|
27
27
|
export { RichQuerySuggestions } from './components/RichQuerySuggestions';
|
|
28
28
|
export { FederatedDropdown } from './components/FederatedDropdown';
|
|
29
29
|
export { SearchBarWithSuggestions } from './components/SearchBarWithSuggestions';
|
|
30
|
-
export { SuggestionsProvider, useSuggestionsContext, SearchInput, DropdownPanel, SuggestionList, SuggestionItem, ItemCard, ItemGrid, ProductCard, ProductGrid, CategoriesTabs, SuggestionsLoading, SuggestionsError, SuggestionsDropdownComposition, RecentSearchesList, TrendingList, } from './components/suggestions-primitives';
|
|
31
|
-
export type { SuggestionsDropdownCompositionProps, RecentSearchesListProps, TrendingListProps, SuggestionsContextValue, SuggestionsProviderProps, SearchInputProps, DropdownPanelProps, SuggestionListProps, SuggestionItemProps, GenericItem, ItemCardProps, ItemGridProps, ProductCardProps, ProductGridProps, CategoriesTabsProps, SuggestionsLoadingProps, SuggestionsErrorProps, ItemCardImageVariant, ProductCardImageVariant, } from './components/suggestions-primitives';
|
|
30
|
+
export { SuggestionsProvider, useSuggestionsContext, SearchInput, DropdownPanel, SuggestionList, SuggestionItem, ItemCard, ItemGrid, ProductCard, ProductGrid, CategoriesTabs, SuggestionsLoading, SuggestionsError, SuggestionsDropdownComposition, RecentSearchesList, TrendingList, parseHighlightMarkup, } from './components/suggestions-primitives';
|
|
31
|
+
export type { SuggestionsDropdownCompositionProps, RecentSearchesListProps, TrendingListProps, SuggestionsContextValue, SuggestionsProviderProps, SearchInputProps, DropdownPanelProps, SuggestionListProps, SuggestionItemProps, HighlightMarkupOptions, GenericItem, ItemCardProps, ItemGridProps, ProductCardProps, ProductGridProps, CategoriesTabsProps, SuggestionsLoadingProps, SuggestionsErrorProps, ItemCardImageVariant, ProductCardImageVariant, } from './components/suggestions-primitives';
|
|
32
32
|
export { ImageDisplay } from './components/primitives';
|
|
33
33
|
export type { ImageDisplayVariant, ImageDisplayProps } from './components/primitives';
|
|
34
34
|
export { SectionSearchProvider, useSectionSearchContext, SectionItemGrid, SectionLoading, SectionError, } from './components/section-primitives';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,MAAM,EAA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AE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,YAAY,EACZ,sBAAsB,EACtB,6BAA6B,EAC7B,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAQtE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ export { SearchBarWithSuggestions } from './components/SearchBarWithSuggestions'
|
|
|
36
36
|
// ============================================================================
|
|
37
37
|
// Composable Suggestions Primitives (generic + product-specific)
|
|
38
38
|
// ============================================================================
|
|
39
|
-
export { SuggestionsProvider, useSuggestionsContext, SearchInput, DropdownPanel, SuggestionList, SuggestionItem, ItemCard, ItemGrid, ProductCard, ProductGrid, CategoriesTabs, SuggestionsLoading, SuggestionsError, SuggestionsDropdownComposition, RecentSearchesList, TrendingList, } from './components/suggestions-primitives';
|
|
39
|
+
export { SuggestionsProvider, useSuggestionsContext, SearchInput, DropdownPanel, SuggestionList, SuggestionItem, ItemCard, ItemGrid, ProductCard, ProductGrid, CategoriesTabs, SuggestionsLoading, SuggestionsError, SuggestionsDropdownComposition, RecentSearchesList, TrendingList, parseHighlightMarkup, } from './components/suggestions-primitives';
|
|
40
40
|
export { ImageDisplay } from './components/primitives';
|
|
41
41
|
export { SectionSearchProvider, useSectionSearchContext, SectionItemGrid, SectionLoading, SectionError, } from './components/section-primitives';
|
|
42
42
|
export { ProductGallery, ProductInfo, ProductRecommendations } from './components/product-page';
|