@akropolys/kiku 1.7.27 → 2.0.0

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.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { SearchResult, AkropolysTheme, ChatSource, Product, VisualSearchResponse } from '@akropolys/sdk';
2
+ import { SearchResult, AkropolysTheme, ChatSource, Product, VisualSearchResponse, Scout } from '@akropolys/sdk';
3
3
 
4
4
  interface SearchBarProps {
5
5
  placeholder?: string;
@@ -20,38 +20,13 @@ interface SearchBarProps {
20
20
  }
21
21
  declare function SearchBar({ placeholder, limit, debounceMs, onSelect, className, inputClassName, dropdownClassName, renderResult, theme, classNames, }: SearchBarProps): React.JSX.Element;
22
22
 
23
- interface ChatWidgetProps {
24
- title?: string;
25
- placeholder?: string;
26
- emptyStateText?: string;
27
- emptyStateSuggestions?: string;
28
- defaultCurrency?: string;
29
- className?: string;
30
- theme?: AkropolysTheme;
31
- classNames?: {
32
- root?: string;
33
- header?: string;
34
- messageBubble?: string;
35
- input?: string;
36
- };
37
- onSelectSource?: (source: ChatSource) => void;
38
- enableVoice?: boolean;
39
- /** Enable 📷 visual style-match search */
40
- enableVision?: boolean;
41
- visionCategoryHint?: string;
42
- /** Enable 🔊 TTS voice audio responses from AI */
43
- enableAudioResponse?: boolean;
44
- /** Optional AI voice preset */
45
- ttsVoice?: string;
46
- autoSpeakResponses?: boolean;
47
- }
48
- declare function ChatWidget({ title, placeholder, emptyStateText, emptyStateSuggestions, defaultCurrency, className, theme, classNames, onSelectSource, enableVoice, enableVision, visionCategoryHint, enableAudioResponse, ttsVoice, autoSpeakResponses }: ChatWidgetProps): React.JSX.Element;
49
-
50
23
  interface KikuButtonProps {
51
24
  label?: React.ReactNode;
52
25
  children?: React.ReactNode;
53
26
  icon?: React.ReactNode;
54
27
  title?: string;
28
+ /** Wordmark shown in place of the name in the topbar. */
29
+ logo?: string;
55
30
  placeholder?: string;
56
31
  backdropColor?: string;
57
32
  backdropBlur?: string | number;
@@ -76,7 +51,7 @@ interface KikuButtonProps {
76
51
  ttsVoice?: string;
77
52
  autoSpeakResponses?: boolean;
78
53
  }
79
- declare function KikuButton({ label, children, icon, title, placeholder, backdropColor, backdropBlur, className, onSelectSource, defaultCurrency, chips, theme, classNames, enableVoice, voiceLang, enableVision, visionCategoryHint, enableAudioResponse, ttsVoice, autoSpeakResponses, }: KikuButtonProps): React.JSX.Element;
54
+ declare function KikuButton({ label, children, icon, title, logo, placeholder, backdropColor, backdropBlur, className, onSelectSource, defaultCurrency, chips, theme, classNames, enableVoice, voiceLang, enableVision, visionCategoryHint, enableAudioResponse, ttsVoice, autoSpeakResponses, }: KikuButtonProps): React.JSX.Element;
80
55
 
81
56
  interface SparkleProps {
82
57
  productName: string;
@@ -98,38 +73,37 @@ interface SparkleProps {
98
73
  }
99
74
  declare function Sparkle({ productName, limit, onResult, backdropColor, backdropBlur, className, onNavigate, theme, classNames, product, children, }: SparkleProps): React.JSX.Element;
100
75
 
101
- interface VoiceButtonProps {
102
- onTranscript: (text: string) => void;
103
- onInterim?: (text: string) => void;
104
- /** BCP-47 tag. Defaults to the page's <html lang>, then the browser language. */
105
- lang?: string;
106
- className?: string;
107
- disabled?: boolean;
108
- /** Raw SpeechRecognition error code — 'not-allowed', 'audio-capture', etc. */
109
- onError?: (code: string) => void;
110
- }
111
- /**
112
- * VoiceButton — speech to text input with pause-based utterance detection.
113
- */
114
- declare function VoiceButton({ onTranscript, onInterim, lang, className, disabled, onError, }: VoiceButtonProps): React.JSX.Element | null;
115
-
116
76
  interface VisualSearchProps {
117
- /** Called with search results + the base64 preview when Gemini responds. */
77
+ /** Called with search results + the base64 preview when the model responds. */
118
78
  onResults: (res: VisualSearchResponse, previewBase64: string) => void;
119
79
  onError?: (err: Error) => void;
120
- /**
121
- * Category hint sent to Gemini to sharpen the match_query.
122
- * e.g. "dress", "curtains", "sofa", "shoes"
123
- */
124
80
  categoryHint?: string;
125
81
  className?: string;
126
82
  disabled?: boolean;
127
83
  }
128
- /**
129
- * VisualSearch — camera/image-upload button for style-match search.
130
- */
131
84
  declare function VisualSearch({ onResults, onError, categoryHint, className, disabled, }: VisualSearchProps): React.JSX.Element;
132
85
 
86
+ interface ScoutRailProps {
87
+ className?: string;
88
+ themeAttr?: string;
89
+ onAsk?: (scout: Scout) => void;
90
+ onNew?: (avatar: string) => void;
91
+ compact?: boolean;
92
+ open?: boolean;
93
+ onOpenChange?: (open: boolean) => void;
94
+ }
95
+ declare function ScoutRail({ className, themeAttr, onAsk, onNew, open: openProp, onOpenChange, compact, }: ScoutRailProps): React.JSX.Element;
96
+
97
+ type ScoutMood = 'watching' | 'resting' | 'struck' | 'gone';
98
+ interface ScoutCharacterProps {
99
+ scoutId: string;
100
+ avatar?: string;
101
+ mood?: ScoutMood;
102
+ size?: number;
103
+ layer?: 'all' | 'body';
104
+ }
105
+ declare function ScoutCharacter({ scoutId, avatar, mood, size, layer }: ScoutCharacterProps): React.JSX.Element;
106
+
133
107
  interface ShopifyProduct {
134
108
  id?: number | string;
135
109
  title?: string;
@@ -205,18 +179,9 @@ declare global {
205
179
  };
206
180
  }
207
181
  }
208
- /**
209
- * Normalizes a Shopify product object into Akropolys entity format.
210
- */
211
182
  declare function normalizeShopifyProduct(p: ShopifyProduct): Record<string, any>;
212
- /**
213
- * Native Shopify Cart Integration.
214
- */
215
183
  declare function shopifyAddToCart(items: ChatSource[]): Promise<any>;
216
- /**
217
- * Native Shopify Get Cart.
218
- */
219
184
  declare function shopifyGetCart(): Promise<any>;
220
185
  declare function initKiku(customConfig?: StandaloneConfig): void;
221
186
 
222
- export { ChatWidget, type ChatWidgetProps, KikuButton, type KikuButtonProps, ChatWidget as KikuChat, type ChatWidgetProps as KikuChatProps, SearchBar, type SearchBarProps, type ShopifyProduct, Sparkle, type StandaloneConfig, VisualSearch, type VisualSearchProps, VoiceButton, type VoiceButtonProps, initKiku, normalizeShopifyProduct, shopifyAddToCart, shopifyGetCart };
187
+ export { KikuButton, type KikuButtonProps, ScoutCharacter, type ScoutCharacterProps, ScoutRail, type ScoutRailProps, SearchBar, type SearchBarProps, type ShopifyProduct, Sparkle, type StandaloneConfig, VisualSearch, type VisualSearchProps, initKiku, normalizeShopifyProduct, shopifyAddToCart, shopifyGetCart };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { SearchResult, AkropolysTheme, ChatSource, Product, VisualSearchResponse } from '@akropolys/sdk';
2
+ import { SearchResult, AkropolysTheme, ChatSource, Product, VisualSearchResponse, Scout } from '@akropolys/sdk';
3
3
 
4
4
  interface SearchBarProps {
5
5
  placeholder?: string;
@@ -20,38 +20,13 @@ interface SearchBarProps {
20
20
  }
21
21
  declare function SearchBar({ placeholder, limit, debounceMs, onSelect, className, inputClassName, dropdownClassName, renderResult, theme, classNames, }: SearchBarProps): React.JSX.Element;
22
22
 
23
- interface ChatWidgetProps {
24
- title?: string;
25
- placeholder?: string;
26
- emptyStateText?: string;
27
- emptyStateSuggestions?: string;
28
- defaultCurrency?: string;
29
- className?: string;
30
- theme?: AkropolysTheme;
31
- classNames?: {
32
- root?: string;
33
- header?: string;
34
- messageBubble?: string;
35
- input?: string;
36
- };
37
- onSelectSource?: (source: ChatSource) => void;
38
- enableVoice?: boolean;
39
- /** Enable 📷 visual style-match search */
40
- enableVision?: boolean;
41
- visionCategoryHint?: string;
42
- /** Enable 🔊 TTS voice audio responses from AI */
43
- enableAudioResponse?: boolean;
44
- /** Optional AI voice preset */
45
- ttsVoice?: string;
46
- autoSpeakResponses?: boolean;
47
- }
48
- declare function ChatWidget({ title, placeholder, emptyStateText, emptyStateSuggestions, defaultCurrency, className, theme, classNames, onSelectSource, enableVoice, enableVision, visionCategoryHint, enableAudioResponse, ttsVoice, autoSpeakResponses }: ChatWidgetProps): React.JSX.Element;
49
-
50
23
  interface KikuButtonProps {
51
24
  label?: React.ReactNode;
52
25
  children?: React.ReactNode;
53
26
  icon?: React.ReactNode;
54
27
  title?: string;
28
+ /** Wordmark shown in place of the name in the topbar. */
29
+ logo?: string;
55
30
  placeholder?: string;
56
31
  backdropColor?: string;
57
32
  backdropBlur?: string | number;
@@ -76,7 +51,7 @@ interface KikuButtonProps {
76
51
  ttsVoice?: string;
77
52
  autoSpeakResponses?: boolean;
78
53
  }
79
- declare function KikuButton({ label, children, icon, title, placeholder, backdropColor, backdropBlur, className, onSelectSource, defaultCurrency, chips, theme, classNames, enableVoice, voiceLang, enableVision, visionCategoryHint, enableAudioResponse, ttsVoice, autoSpeakResponses, }: KikuButtonProps): React.JSX.Element;
54
+ declare function KikuButton({ label, children, icon, title, logo, placeholder, backdropColor, backdropBlur, className, onSelectSource, defaultCurrency, chips, theme, classNames, enableVoice, voiceLang, enableVision, visionCategoryHint, enableAudioResponse, ttsVoice, autoSpeakResponses, }: KikuButtonProps): React.JSX.Element;
80
55
 
81
56
  interface SparkleProps {
82
57
  productName: string;
@@ -98,38 +73,37 @@ interface SparkleProps {
98
73
  }
99
74
  declare function Sparkle({ productName, limit, onResult, backdropColor, backdropBlur, className, onNavigate, theme, classNames, product, children, }: SparkleProps): React.JSX.Element;
100
75
 
101
- interface VoiceButtonProps {
102
- onTranscript: (text: string) => void;
103
- onInterim?: (text: string) => void;
104
- /** BCP-47 tag. Defaults to the page's <html lang>, then the browser language. */
105
- lang?: string;
106
- className?: string;
107
- disabled?: boolean;
108
- /** Raw SpeechRecognition error code — 'not-allowed', 'audio-capture', etc. */
109
- onError?: (code: string) => void;
110
- }
111
- /**
112
- * VoiceButton — speech to text input with pause-based utterance detection.
113
- */
114
- declare function VoiceButton({ onTranscript, onInterim, lang, className, disabled, onError, }: VoiceButtonProps): React.JSX.Element | null;
115
-
116
76
  interface VisualSearchProps {
117
- /** Called with search results + the base64 preview when Gemini responds. */
77
+ /** Called with search results + the base64 preview when the model responds. */
118
78
  onResults: (res: VisualSearchResponse, previewBase64: string) => void;
119
79
  onError?: (err: Error) => void;
120
- /**
121
- * Category hint sent to Gemini to sharpen the match_query.
122
- * e.g. "dress", "curtains", "sofa", "shoes"
123
- */
124
80
  categoryHint?: string;
125
81
  className?: string;
126
82
  disabled?: boolean;
127
83
  }
128
- /**
129
- * VisualSearch — camera/image-upload button for style-match search.
130
- */
131
84
  declare function VisualSearch({ onResults, onError, categoryHint, className, disabled, }: VisualSearchProps): React.JSX.Element;
132
85
 
86
+ interface ScoutRailProps {
87
+ className?: string;
88
+ themeAttr?: string;
89
+ onAsk?: (scout: Scout) => void;
90
+ onNew?: (avatar: string) => void;
91
+ compact?: boolean;
92
+ open?: boolean;
93
+ onOpenChange?: (open: boolean) => void;
94
+ }
95
+ declare function ScoutRail({ className, themeAttr, onAsk, onNew, open: openProp, onOpenChange, compact, }: ScoutRailProps): React.JSX.Element;
96
+
97
+ type ScoutMood = 'watching' | 'resting' | 'struck' | 'gone';
98
+ interface ScoutCharacterProps {
99
+ scoutId: string;
100
+ avatar?: string;
101
+ mood?: ScoutMood;
102
+ size?: number;
103
+ layer?: 'all' | 'body';
104
+ }
105
+ declare function ScoutCharacter({ scoutId, avatar, mood, size, layer }: ScoutCharacterProps): React.JSX.Element;
106
+
133
107
  interface ShopifyProduct {
134
108
  id?: number | string;
135
109
  title?: string;
@@ -205,18 +179,9 @@ declare global {
205
179
  };
206
180
  }
207
181
  }
208
- /**
209
- * Normalizes a Shopify product object into Akropolys entity format.
210
- */
211
182
  declare function normalizeShopifyProduct(p: ShopifyProduct): Record<string, any>;
212
- /**
213
- * Native Shopify Cart Integration.
214
- */
215
183
  declare function shopifyAddToCart(items: ChatSource[]): Promise<any>;
216
- /**
217
- * Native Shopify Get Cart.
218
- */
219
184
  declare function shopifyGetCart(): Promise<any>;
220
185
  declare function initKiku(customConfig?: StandaloneConfig): void;
221
186
 
222
- export { ChatWidget, type ChatWidgetProps, KikuButton, type KikuButtonProps, ChatWidget as KikuChat, type ChatWidgetProps as KikuChatProps, SearchBar, type SearchBarProps, type ShopifyProduct, Sparkle, type StandaloneConfig, VisualSearch, type VisualSearchProps, VoiceButton, type VoiceButtonProps, initKiku, normalizeShopifyProduct, shopifyAddToCart, shopifyGetCart };
187
+ export { KikuButton, type KikuButtonProps, ScoutCharacter, type ScoutCharacterProps, ScoutRail, type ScoutRailProps, SearchBar, type SearchBarProps, type ShopifyProduct, Sparkle, type StandaloneConfig, VisualSearch, type VisualSearchProps, initKiku, normalizeShopifyProduct, shopifyAddToCart, shopifyGetCart };