@xapp/form-widget 1.62.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.
Files changed (239) hide show
  1. package/LICENSE.md +176 -0
  2. package/README.md +3 -0
  3. package/dist/App.d.ts +23 -0
  4. package/dist/api/index.d.ts +1 -0
  5. package/dist/api/stentor-api.d.ts +18 -0
  6. package/dist/components/Button/Button.d.ts +8 -0
  7. package/dist/components/Button/Button.stories.d.ts +6 -0
  8. package/dist/components/Button/index.d.ts +1 -0
  9. package/dist/components/Card/Card.d.ts +8 -0
  10. package/dist/components/Card/Card.stories.d.ts +9 -0
  11. package/dist/components/Card/Card.test.d.ts +1 -0
  12. package/dist/components/Card/index.d.ts +1 -0
  13. package/dist/components/Card/utils.d.ts +1 -0
  14. package/dist/components/Cards/Cards.d.ts +7 -0
  15. package/dist/components/Cards/Cards.stories.d.ts +7 -0
  16. package/dist/components/Cards/index.d.ts +1 -0
  17. package/dist/components/Carousel/Carousel.d.ts +7 -0
  18. package/dist/components/Carousel/Carousel.stories.d.ts +8 -0
  19. package/dist/components/Carousel/CarouselItem.d.ts +6 -0
  20. package/dist/components/Carousel/index.d.ts +1 -0
  21. package/dist/components/ChatButton/ChatButton.d.ts +13 -0
  22. package/dist/components/ChatButton/ChatButton.stories.d.ts +6 -0
  23. package/dist/components/ChatButton/index.d.ts +1 -0
  24. package/dist/components/FormFieldCard/FormFieldCard.d.ts +7 -0
  25. package/dist/components/FormFieldCard/index.d.ts +1 -0
  26. package/dist/components/FormFieldChips/FormFieldChips.d.ts +8 -0
  27. package/dist/components/FormFieldChips/FormFieldSelect.d.ts +7 -0
  28. package/dist/components/FormFieldChips/index.d.ts +1 -0
  29. package/dist/components/FormFieldDate/FormFieldDate.d.ts +7 -0
  30. package/dist/components/FormFieldDate/index.d.ts +1 -0
  31. package/dist/components/FormFieldDateRange/FormFieldDateRange.d.ts +7 -0
  32. package/dist/components/FormFieldDateRange/index.d.ts +1 -0
  33. package/dist/components/FormFieldDropdown/FormFieldDropdown.d.ts +7 -0
  34. package/dist/components/FormFieldDropdown/index.d.ts +1 -0
  35. package/dist/components/FormFieldTextInput/FormFieldTextInput.d.ts +9 -0
  36. package/dist/components/FormFieldTextInput/index.d.ts +1 -0
  37. package/dist/components/FormStepDisplay/FormStepDisplay.d.ts +14 -0
  38. package/dist/components/FormStepDisplay/index.d.ts +2 -0
  39. package/dist/components/FormStepDisplay/validators.d.ts +8 -0
  40. package/dist/components/IconLabel/IconLabel.d.ts +9 -0
  41. package/dist/components/IconLabel/IconLabel.stories.d.ts +5 -0
  42. package/dist/components/IconLabel/index.d.ts +1 -0
  43. package/dist/components/LinkButton/LinkButton.d.ts +8 -0
  44. package/dist/components/LinkButton/LinkButton.stories.d.ts +6 -0
  45. package/dist/components/LinkButton/index.d.ts +1 -0
  46. package/dist/components/ModalDialog/ModalDialog.d.ts +6 -0
  47. package/dist/components/ModalDialog/ModalDialog.stories.d.ts +5 -0
  48. package/dist/components/ModalDialog/index.d.ts +1 -0
  49. package/dist/components/Search/Search.d.ts +14 -0
  50. package/dist/components/Search/Search.stories.d.ts +12 -0
  51. package/dist/components/Search/index.d.ts +1 -0
  52. package/dist/components/SearchInput/SearchInput.d.ts +16 -0
  53. package/dist/components/SearchInput/SearchInput.stories.d.ts +6 -0
  54. package/dist/components/SearchInput/SearchInputContainer.d.ts +4 -0
  55. package/dist/components/SearchInput/index.d.ts +2 -0
  56. package/dist/components/SearchResponse/SearchResponse.d.ts +11 -0
  57. package/dist/components/SearchResponse/SearchResponse.stories.d.ts +13 -0
  58. package/dist/components/SearchResponse/index.d.ts +1 -0
  59. package/dist/components/SearchResponseAudio/SearchResponseAudio.d.ts +6 -0
  60. package/dist/components/SearchResponseAudio/SearchResponseAudio.stories.d.ts +5 -0
  61. package/dist/components/SearchResponseAudio/index.d.ts +1 -0
  62. package/dist/components/SearchResponseBubble/SearchResponseBubble.d.ts +5 -0
  63. package/dist/components/SearchResponseBubble/SearchResponseBubble.stories.d.ts +5 -0
  64. package/dist/components/SearchResponseBubble/index.d.ts +1 -0
  65. package/dist/components/SearchResponseCarouselDisplay/SearchResponseCarouselDisplay.d.ts +6 -0
  66. package/dist/components/SearchResponseCarouselDisplay/SearchResponseCarouselDisplay.stories.d.ts +5 -0
  67. package/dist/components/SearchResponseCarouselDisplay/index.d.ts +1 -0
  68. package/dist/components/SearchResponseDisplay/SearchResponseDisplay.d.ts +7 -0
  69. package/dist/components/SearchResponseDisplay/index.d.ts +1 -0
  70. package/dist/components/SearchResponseFormDisplay/SearchResponseFormDisplay.d.ts +8 -0
  71. package/dist/components/SearchResponseFormDisplay/index.d.ts +2 -0
  72. package/dist/components/SearchResponseFormDisplay/model.d.ts +132 -0
  73. package/dist/components/SearchResponseHtml/SearchResponseHtml.d.ts +5 -0
  74. package/dist/components/SearchResponseHtml/SearchResponseHtml.stories.d.ts +5 -0
  75. package/dist/components/SearchResponseHtml/index.d.ts +1 -0
  76. package/dist/components/SearchResponseListDisplay/SearchResponseListDisplay.d.ts +6 -0
  77. package/dist/components/SearchResponseListDisplay/SearchResponseListDisplay.stories.d.ts +6 -0
  78. package/dist/components/SearchResponseListDisplay/index.d.ts +1 -0
  79. package/dist/components/SearchResponseOutputSpeech/SearchResponseOutputSpeech.d.ts +8 -0
  80. package/dist/components/SearchResponseOutputSpeech/SearchResponseOutputSpeech.stories.d.ts +8 -0
  81. package/dist/components/SearchResponseOutputSpeech/index.d.ts +1 -0
  82. package/dist/components/SearchResponsePart/SearchResponsePart.d.ts +6 -0
  83. package/dist/components/SearchResponsePart/index.d.ts +1 -0
  84. package/dist/components/SearchResponseText/SearchResponseText.d.ts +5 -0
  85. package/dist/components/SearchResponseText/SearchResponseText.stories.d.ts +5 -0
  86. package/dist/components/SearchResponseText/index.d.ts +1 -0
  87. package/dist/components/SearchResult/SearchResult.d.ts +13 -0
  88. package/dist/components/SearchResult/SearchResult.stories.d.ts +5 -0
  89. package/dist/components/SearchResult/SearchResult.test.d.ts +1 -0
  90. package/dist/components/SearchResult/index.d.ts +1 -0
  91. package/dist/components/SearchWidget/SearchWidget.d.ts +8 -0
  92. package/dist/components/SearchWidget/SearchWidget.stories.d.ts +9 -0
  93. package/dist/components/SearchWidget/index.d.ts +1 -0
  94. package/dist/components/SimpleNavigationHeader/SimpleNavigationHeader.d.ts +8 -0
  95. package/dist/components/SimpleNavigationHeader/index.d.ts +1 -0
  96. package/dist/components/SuggestedAction/SuggestedAction.d.ts +9 -0
  97. package/dist/components/SuggestedAction/SuggestedAction.stories.d.ts +7 -0
  98. package/dist/components/SuggestedAction/index.d.ts +1 -0
  99. package/dist/components/SuggestedActions/SuggestedActions.d.ts +9 -0
  100. package/dist/components/SuggestedActions/SuggestedActions.stories.d.ts +5 -0
  101. package/dist/components/SuggestedActions/index.d.ts +1 -0
  102. package/dist/components/UknownMessage/UnknownMessage.d.ts +2 -0
  103. package/dist/components/UknownMessage/index.d.ts +1 -0
  104. package/dist/components/WidgetStylesheet/WidgetStylesheet.d.ts +7 -0
  105. package/dist/components/WidgetStylesheet/index.d.ts +1 -0
  106. package/dist/components/icons/BigMicIcon/BigMicIcon.d.ts +6 -0
  107. package/dist/components/icons/BigMicIcon/index.d.ts +1 -0
  108. package/dist/components/icons/Icon.stories.d.ts +5 -0
  109. package/dist/components/icons/LeftAngleIcon/LeftAngleIcon.d.ts +2 -0
  110. package/dist/components/icons/LeftAngleIcon/index.d.ts +1 -0
  111. package/dist/components/icons/MicIcons/MicIconEmpty.d.ts +2 -0
  112. package/dist/components/icons/MicIcons/MicIconFill.d.ts +2 -0
  113. package/dist/components/icons/MicIcons/index.d.ts +2 -0
  114. package/dist/components/icons/RightAngleIcon/RightAngleIcon.d.ts +2 -0
  115. package/dist/components/icons/RightAngleIcon/index.d.ts +1 -0
  116. package/dist/components/icons/SearchIcon/SearchIcon.d.ts +2 -0
  117. package/dist/components/icons/SearchIcon/index.d.ts +1 -0
  118. package/dist/components/icons/SpinnerIcon/SpinnerIcon.d.ts +2 -0
  119. package/dist/components/icons/SpinnerIcon/index.d.ts +1 -0
  120. package/dist/components/icons/index.d.ts +4 -0
  121. package/dist/components/index.d.ts +2 -0
  122. package/dist/config/config.d.ts +8 -0
  123. package/dist/config/index.d.ts +2 -0
  124. package/dist/config/search-config.d.ts +10 -0
  125. package/dist/config/theme.d.ts +76 -0
  126. package/dist/constants/variables.d.ts +3 -0
  127. package/dist/index.css +1 -0
  128. package/dist/index.d.ts +4 -0
  129. package/dist/index.es.js +107046 -0
  130. package/dist/index.es.js.map +1 -0
  131. package/dist/index.js +107080 -0
  132. package/dist/index.js.map +1 -0
  133. package/dist/middlewares/index.d.ts +2 -0
  134. package/dist/middlewares/join.d.ts +2 -0
  135. package/dist/middlewares/message-middleware.d.ts +14 -0
  136. package/dist/middlewares/use-middleware.d.ts +10 -0
  137. package/dist/setupTests.d.ts +1 -0
  138. package/dist/store/SearchDispatch.d.ts +2 -0
  139. package/dist/store/SearchState.d.ts +19 -0
  140. package/dist/store/SearchStore.d.ts +3 -0
  141. package/dist/store/SearchStoreContext.d.ts +5 -0
  142. package/dist/store/SearchStoreProvider.d.ts +6 -0
  143. package/dist/store/actions/BaseSearchAction.d.ts +4 -0
  144. package/dist/store/actions/NewSearchAction.d.ts +3 -0
  145. package/dist/store/actions/SearchAction.d.ts +6 -0
  146. package/dist/store/actions/SearchActionType.d.ts +1 -0
  147. package/dist/store/actions/SetModalStateAction.d.ts +6 -0
  148. package/dist/store/actions/SetQueryAction.d.ts +5 -0
  149. package/dist/store/actions/SetResponseAction.d.ts +12 -0
  150. package/dist/store/actions/ToggleModalStateAction.d.ts +3 -0
  151. package/dist/store/actions/index.d.ts +1 -0
  152. package/dist/store/index.d.ts +7 -0
  153. package/dist/store/reducers/RootReducer.d.ts +3 -0
  154. package/dist/store/reducers/index.d.ts +1 -0
  155. package/dist/store/useSearchDispatch.d.ts +2 -0
  156. package/dist/store/useSearchState.d.ts +2 -0
  157. package/dist/store/useSearchStore.d.ts +2 -0
  158. package/dist/stories/DummyContent.d.ts +2 -0
  159. package/dist/stories/RichTextValues.d.ts +2 -0
  160. package/dist/stories/ThemeBuilder/ThemeBuilderSection/ThemeBuilderSection.d.ts +8 -0
  161. package/dist/stories/ThemeBuilder/ThemeBuilderSection/index.d.ts +1 -0
  162. package/dist/stories/ThemeBuilder/ThemeBuilderSectionLine/ThemeBuilderSectionLine.d.ts +7 -0
  163. package/dist/stories/ThemeBuilder/ThemeBuilderSectionLine/index.d.ts +1 -0
  164. package/dist/stories/ThemeBuilder/WidgetBackgroundThemeBuilder/WidgetBackgroundThemeBuilder.d.ts +11 -0
  165. package/dist/stories/ThemeBuilder/WidgetBackgroundThemeBuilder/index.d.ts +1 -0
  166. package/dist/stories/ThemeBuilder/WidgetBorderRadiusPicker/WidgetBorderRadiusPicker.d.ts +9 -0
  167. package/dist/stories/ThemeBuilder/WidgetBorderRadiusPicker/index.d.ts +1 -0
  168. package/dist/stories/ThemeBuilder/WidgetBorderThemeBuilder/WidgetBorderThemeBuilder.d.ts +11 -0
  169. package/dist/stories/ThemeBuilder/WidgetBorderThemeBuilder/index.d.ts +1 -0
  170. package/dist/stories/ThemeBuilder/WidgetBorderWidthPicker/WidgetBorderWidthPicker.d.ts +9 -0
  171. package/dist/stories/ThemeBuilder/WidgetBorderWidthPicker/index.d.ts +1 -0
  172. package/dist/stories/ThemeBuilder/WidgetCardThemeBuilder/WidgetCardThemeBuilder.d.ts +10 -0
  173. package/dist/stories/ThemeBuilder/WidgetCardThemeBuilder/index.d.ts +1 -0
  174. package/dist/stories/ThemeBuilder/WidgetCarouselThemeBuilder/WidgetCarouselThemeBuilder.d.ts +10 -0
  175. package/dist/stories/ThemeBuilder/WidgetCarouselThemeBuilder/index.d.ts +1 -0
  176. package/dist/stories/ThemeBuilder/WidgetColorPicker/WidgetColorPicker.d.ts +12 -0
  177. package/dist/stories/ThemeBuilder/WidgetColorPicker/index.d.ts +1 -0
  178. package/dist/stories/ThemeBuilder/WidgetFontFamilyPicker/WidgetFontFamilyPicker.d.ts +12 -0
  179. package/dist/stories/ThemeBuilder/WidgetFontFamilyPicker/index.d.ts +1 -0
  180. package/dist/stories/ThemeBuilder/WidgetFontSizePicker/WidgetFontSizePicker.d.ts +9 -0
  181. package/dist/stories/ThemeBuilder/WidgetFontSizePicker/index.d.ts +1 -0
  182. package/dist/stories/ThemeBuilder/WidgetFontStylePicker/WidgetFontStylePicker.d.ts +12 -0
  183. package/dist/stories/ThemeBuilder/WidgetFontStylePicker/index.d.ts +1 -0
  184. package/dist/stories/ThemeBuilder/WidgetFontWeightPicker/WidgetFontWeightPicker.d.ts +12 -0
  185. package/dist/stories/ThemeBuilder/WidgetFontWeightPicker/index.d.ts +1 -0
  186. package/dist/stories/ThemeBuilder/WidgetLengthPicker/WidgetLengthPicker.d.ts +11 -0
  187. package/dist/stories/ThemeBuilder/WidgetLengthPicker/index.d.ts +1 -0
  188. package/dist/stories/ThemeBuilder/WidgetLengthPickerLine/WidgetLengthPickerLine.d.ts +10 -0
  189. package/dist/stories/ThemeBuilder/WidgetLengthPickerLine/index.d.ts +1 -0
  190. package/dist/stories/ThemeBuilder/WidgetLinkBlockThemeBuilder/WidgetLinkBlockThemeBuilder.d.ts +10 -0
  191. package/dist/stories/ThemeBuilder/WidgetLinkBlockThemeBuilder/index.d.ts +1 -0
  192. package/dist/stories/ThemeBuilder/WidgetLinkThemeBuilder/WidgetLinkThemeBuilder.d.ts +10 -0
  193. package/dist/stories/ThemeBuilder/WidgetLinkThemeBuilder/index.d.ts +1 -0
  194. package/dist/stories/ThemeBuilder/WidgetListThemeBuilder/WidgetListThemeBuilder.d.ts +10 -0
  195. package/dist/stories/ThemeBuilder/WidgetListThemeBuilder/index.d.ts +1 -0
  196. package/dist/stories/ThemeBuilder/WidgetMarginPicker/WidgetMarginPicker.d.ts +10 -0
  197. package/dist/stories/ThemeBuilder/WidgetMarginPicker/index.d.ts +1 -0
  198. package/dist/stories/ThemeBuilder/WidgetPaddingPicker/WidgetPaddingPicker.d.ts +10 -0
  199. package/dist/stories/ThemeBuilder/WidgetPaddingPicker/index.d.ts +1 -0
  200. package/dist/stories/ThemeBuilder/WidgetTextBlockThemeBuilder/WidgetTextBlockThemeBuilder.d.ts +10 -0
  201. package/dist/stories/ThemeBuilder/WidgetTextBlockThemeBuilder/index.d.ts +1 -0
  202. package/dist/stories/ThemeBuilder/WidgetTextThemeBuilder/WidgetTextThemeBuilder.d.ts +10 -0
  203. package/dist/stories/ThemeBuilder/WidgetTextThemeBuilder/index.d.ts +1 -0
  204. package/dist/stories/ThemeBuilder/WidgetThemeBuilder/WidgetThemeBuilder.d.ts +8 -0
  205. package/dist/stories/ThemeBuilder/WidgetThemeBuilder/index.d.ts +1 -0
  206. package/dist/stories/ThemeBuilder/WidgetValuePicker/WidgetValuePicker.d.ts +16 -0
  207. package/dist/stories/ThemeBuilder/WidgetValuePicker/index.d.ts +1 -0
  208. package/dist/stories/base-list-display.d.ts +2 -0
  209. package/dist/stories/carousel-display.d.ts +2 -0
  210. package/dist/stories/carousel-response.d.ts +2 -0
  211. package/dist/stories/config.d.ts +5 -0
  212. package/dist/stories/list-display.d.ts +2 -0
  213. package/dist/stories/list-response.d.ts +2 -0
  214. package/dist/stories/random-theme.d.ts +3 -0
  215. package/dist/stories/response-filter.d.ts +5 -0
  216. package/dist/stories/suggestions-groups.d.ts +4 -0
  217. package/dist/stories/text-response.d.ts +2 -0
  218. package/dist/stories/useOnChangeChildDispatch.d.ts +4 -0
  219. package/dist/utils/SearchWidgetConfigContext.d.ts +3 -0
  220. package/dist/utils/comparator.d.ts +11 -0
  221. package/dist/utils/getActionLabel.d.ts +2 -0
  222. package/dist/utils/guards/index.d.ts +5 -0
  223. package/dist/utils/guards/isCarousel.d.ts +2 -0
  224. package/dist/utils/guards/isField.d.ts +3 -0
  225. package/dist/utils/guards/isForm.d.ts +3 -0
  226. package/dist/utils/guards/isList.d.ts +2 -0
  227. package/dist/utils/guards/throwBadKind.d.ts +1 -0
  228. package/dist/utils/index.d.ts +6 -0
  229. package/dist/utils/parseAudio.d.ts +1 -0
  230. package/dist/utils/parseEnv.d.ts +1 -0
  231. package/dist/utils/subscribable-array.d.ts +12 -0
  232. package/dist/utils/templating.d.ts +3 -0
  233. package/dist/utils/useExternalScript.d.ts +1 -0
  234. package/dist/utils/useFetchStylesheet.d.ts +1 -0
  235. package/dist/utils/useIsMounted.d.ts +1 -0
  236. package/dist/utils/useLoading.d.ts +7 -0
  237. package/dist/utils/useSuggestionsFetch.d.ts +2 -0
  238. package/dist/utils/useSuggestionsUrl.d.ts +1 -0
  239. package/package.json +114 -0
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ export interface SearchResponseAudioProps {
3
+ readonly audio: string;
4
+ onAudioChange(isOn: boolean): void;
5
+ }
6
+ export declare const SearchResponseAudio: FC<SearchResponseAudioProps>;
@@ -0,0 +1,5 @@
1
+ import { Meta } from "@storybook/react/types-6-0";
2
+ import { VFC } from "react";
3
+ declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
+ export default _default;
5
+ export declare const Default: VFC;
@@ -0,0 +1 @@
1
+ export { SearchResponseAudio, SearchResponseAudioProps } from "./SearchResponseAudio";
@@ -0,0 +1,5 @@
1
+ import { FC, PropsWithChildren } from "react";
2
+ import "./SearchResponseBubble.scss";
3
+ export interface SearchResponseBubbleProps {
4
+ }
5
+ export declare const SearchResponseBubble: FC<PropsWithChildren<SearchResponseBubbleProps>>;
@@ -0,0 +1,5 @@
1
+ import { Meta } from "@storybook/react/types-6-0";
2
+ import { VFC } from "react";
3
+ declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
+ export default _default;
5
+ export declare const Default: VFC;
@@ -0,0 +1 @@
1
+ export { SearchResponseBubble, SearchResponseBubbleProps } from "./SearchResponseBubble";
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ import { List } from "stentor-models";
3
+ export interface SearchResponseCarouselDisplayProps {
4
+ readonly carousel: List;
5
+ }
6
+ export declare const SearchResponseCarouselDisplay: FC<SearchResponseCarouselDisplayProps>;
@@ -0,0 +1,5 @@
1
+ import { Meta } from "@storybook/react/types-6-0";
2
+ import { VFC } from "react";
3
+ declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
+ export default _default;
5
+ export declare const Default: VFC;
@@ -0,0 +1 @@
1
+ export { SearchResponseCarouselDisplay } from "./SearchResponseCarouselDisplay";
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ import { Display } from "stentor-models";
3
+ export interface SearchResponseDisplayProps {
4
+ readonly display: Display;
5
+ onActionResponse(data: unknown, action: string): void;
6
+ }
7
+ export declare const SearchResponseDisplay: FC<SearchResponseDisplayProps>;
@@ -0,0 +1 @@
1
+ export { SearchResponseDisplay } from "./SearchResponseDisplay";
@@ -0,0 +1,8 @@
1
+ import { FC } from "react";
2
+ import { MultistepForm } from ".";
3
+ import "./SearchResponseFormDisplay.scss";
4
+ export interface SearchResponseFormDisplayProps {
5
+ readonly form: MultistepForm;
6
+ onActionResponse(data: unknown, action: string): void;
7
+ }
8
+ export declare const SearchResponseFormDisplay: FC<SearchResponseFormDisplayProps>;
@@ -0,0 +1,2 @@
1
+ export { SearchResponseFormDisplay } from "./SearchResponseFormDisplay";
2
+ export * from "./model";
@@ -0,0 +1,132 @@
1
+ import { BaseDisplay } from "stentor-models";
2
+ /**
3
+ * Action response data object
4
+ */
5
+ export interface FormActionResponseData {
6
+ result: object;
7
+ step: string;
8
+ form: string;
9
+ }
10
+ /**
11
+ * FORM Display type (TODO: add the final to Stentor)
12
+ */
13
+ export interface MultistepForm extends BaseDisplay {
14
+ type: "FORM";
15
+ name: string;
16
+ header: FormHeaderItem[];
17
+ steps: FormStep[];
18
+ }
19
+ /**
20
+ * This is for the top header. The "step" is the name of the step the click should take to.
21
+ */
22
+ export interface FormHeaderItem {
23
+ label: string;
24
+ step: string;
25
+ }
26
+ export interface FormFieldProps {
27
+ hidden?: true;
28
+ onFieldChange: (fieldName: string, fieldValue: string | string[] | object | undefined) => void;
29
+ errorMessage?: string;
30
+ required?: boolean;
31
+ }
32
+ /**
33
+ * A step is partial form. Fields plus next/prev/submit buttons as needed.
34
+ * We are going through these "mini screens".
35
+ */
36
+ export interface FormStep {
37
+ name: string;
38
+ title?: string;
39
+ fields: FormField[];
40
+ nextAction?: "next" | "submit" | "omit";
41
+ previousAction?: "previous" | "submit" | "omit";
42
+ nextLabel?: string;
43
+ previousLabel?: string;
44
+ }
45
+ export declare type FormField = FormTextInput | FormDropdownInput | FormChipsInput | FormDateInput | FormDateRangeInput;
46
+ /**
47
+ * Form field base class
48
+ */
49
+ export interface FormInput {
50
+ name: string;
51
+ title?: string;
52
+ type: "TEXT" | "DROPDOWN" | "CHECK" | "CHIPS" | "DATE" | "DATERANGE" | "CARD";
53
+ shape?: "ROUND" | "SQUARE";
54
+ condition?: string;
55
+ mandatory?: boolean;
56
+ style?: object;
57
+ }
58
+ /**
59
+ * Text input. Validate according to the format.
60
+ */
61
+ export interface FormTextInput extends FormInput {
62
+ multiline?: boolean;
63
+ format?: "PHONE" | "EMAIL";
64
+ placeholder?: string;
65
+ label?: string;
66
+ rows?: number;
67
+ rowsMax?: number;
68
+ }
69
+ /**
70
+ * Dropdown
71
+ */
72
+ export interface FormDropdownInput extends FormInput {
73
+ items: SelectableItem[];
74
+ }
75
+ /**
76
+ * Close/Open style chisp selection. Header plus open symbol reveals the chips.
77
+ */
78
+ export interface FormChipsInput extends FormInput {
79
+ radio?: boolean;
80
+ defaultOpen?: boolean;
81
+ minRequired?: number;
82
+ maxAllowed?: number;
83
+ items: SelectableItem[];
84
+ }
85
+ /**
86
+ * Like chips but with checkboxes
87
+ */
88
+ export interface FormSelectInput extends FormInput {
89
+ radio?: boolean;
90
+ defaultOpen?: boolean;
91
+ items: SelectableItem[];
92
+ }
93
+ /**
94
+ * Card (text/image)
95
+ */
96
+ export interface FormCardInput extends FormInput {
97
+ header?: {
98
+ title: string;
99
+ subheader?: string;
100
+ };
101
+ media?: {
102
+ heightPx: number;
103
+ imageUrl: string;
104
+ alt?: string;
105
+ };
106
+ text?: string;
107
+ variant?: string;
108
+ color?: string;
109
+ align?: string;
110
+ }
111
+ /**
112
+ * Single date
113
+ */
114
+ export interface FormDateInput extends FormInput {
115
+ preselecteDate?: Date;
116
+ }
117
+ /**
118
+ * Date range
119
+ */
120
+ export interface FormDateRangeInput extends FormInput {
121
+ preselecteDates?: {
122
+ from?: Date;
123
+ to?: Date;
124
+ };
125
+ }
126
+ /**
127
+ * Basically a name value pair for dropdowns or chips
128
+ */
129
+ export interface SelectableItem {
130
+ label: string;
131
+ id: string;
132
+ }
@@ -0,0 +1,5 @@
1
+ import { FC } from "react";
2
+ export interface SearchResponseHtmlProps {
3
+ readonly html: string;
4
+ }
5
+ export declare const SearchResponseHtml: FC<SearchResponseHtmlProps>;
@@ -0,0 +1,5 @@
1
+ import { Meta } from "@storybook/react/types-6-0";
2
+ import { VFC } from "react";
3
+ declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
+ export default _default;
5
+ export declare const Default: VFC;
@@ -0,0 +1 @@
1
+ export { SearchResponseHtml, SearchResponseHtmlProps } from "./SearchResponseHtml";
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ import { List } from "stentor-models";
3
+ export interface SearchResponseListDisplayProps {
4
+ readonly list: List;
5
+ }
6
+ export declare const SearchResponseListDisplay: FC<SearchResponseListDisplayProps>;
@@ -0,0 +1,6 @@
1
+ import { Meta } from "@storybook/react/types-6-0";
2
+ import { VFC } from "react";
3
+ declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
+ export default _default;
5
+ export declare const Default: VFC;
6
+ export declare const WithTitle: VFC;
@@ -0,0 +1 @@
1
+ export { SearchResponseListDisplay } from "./SearchResponseListDisplay";
@@ -0,0 +1,8 @@
1
+ import { FC } from "react";
2
+ import { ResponseOutput } from "stentor-models";
3
+ import "./SearchResponseOutputSpeech.scss";
4
+ export interface SearchResponseOutputSpeechProps {
5
+ readonly outputSpeech: ResponseOutput | string;
6
+ onAudioChange(isOn: boolean): void;
7
+ }
8
+ export declare const SearchResponseOutputSpeech: FC<SearchResponseOutputSpeechProps>;
@@ -0,0 +1,8 @@
1
+ import { Meta } from "@storybook/react/types-6-0";
2
+ import { VFC } from "react";
3
+ declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
+ export default _default;
5
+ export declare const TextResponse: VFC;
6
+ export declare const HtmlResponse: VFC;
7
+ export declare const TextAndHtmlResponse: VFC;
8
+ export declare const Styled: VFC;
@@ -0,0 +1 @@
1
+ export { SearchResponseOutputSpeech, SearchResponseOutputSpeechProps } from "./SearchResponseOutputSpeech";
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ import "./SearchResponsePart.scss";
3
+ export interface SearchResponsePartProps {
4
+ extraClass?: string;
5
+ }
6
+ export declare const SearchResponsePart: FC<SearchResponsePartProps>;
@@ -0,0 +1 @@
1
+ export { SearchResponsePart, SearchResponsePartProps } from "./SearchResponsePart";
@@ -0,0 +1,5 @@
1
+ import { FC } from "react";
2
+ export interface SearchResponseTextProps {
3
+ readonly text: string;
4
+ }
5
+ export declare const SearchResponseText: FC<SearchResponseTextProps>;
@@ -0,0 +1,5 @@
1
+ import { Meta } from "@storybook/react/types-6-0";
2
+ import { VFC } from "react";
3
+ declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
+ export default _default;
5
+ export declare const Default: VFC;
@@ -0,0 +1 @@
1
+ export { SearchResponseText, SearchResponseTextProps } from "./SearchResponseText";
@@ -0,0 +1,13 @@
1
+ import { SuggestionsGroupData, SuggestionsItemData } from "@xapp/chat-widget-core";
2
+ import "@xapp/chat-widget-core/dist/index.css";
3
+ import { FC, VFC } from "react";
4
+ import "./SearchResult.scss";
5
+ export interface SearchResultProps {
6
+ readonly result: readonly SuggestionsGroupData[];
7
+ readonly index: number;
8
+ readonly className?: string;
9
+ onItemClick(data: SuggestionsItemData): void;
10
+ onItemUse(data: SuggestionsItemData): void;
11
+ }
12
+ export declare const SearchResult: FC<SearchResultProps>;
13
+ export declare const SuggestionsItemActions: VFC;
@@ -0,0 +1,5 @@
1
+ import { Meta } from "@storybook/react/types-6-0";
2
+ import { VFC } from "react";
3
+ declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
+ export default _default;
5
+ export declare const Default: VFC;
@@ -0,0 +1 @@
1
+ export { SearchResult, SearchResultProps } from "./SearchResult";
@@ -0,0 +1,8 @@
1
+ import { FC } from "react";
2
+ import { SearchWidgetConfig } from "../../config";
3
+ import "./SearchWidget.scss";
4
+ export declare const AUDIO_WAIT_NOTHING = 0, AUDIO_WAIT_CLOSE = 1, AUDIO_WAIT_MINIMIZE = 2;
5
+ export interface SearchWidgetProps {
6
+ readonly config: SearchWidgetConfig;
7
+ }
8
+ export declare const SearchWidget: FC<SearchWidgetProps>;
@@ -0,0 +1,9 @@
1
+ import { Meta } from "@storybook/react/types-6-0";
2
+ import { VFC } from "react";
3
+ declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
+ export default _default;
5
+ export declare const Default: VFC;
6
+ export declare const InModal: VFC;
7
+ export declare const WithTextResponse: VFC;
8
+ export declare const WithListResponse: VFC;
9
+ export declare const WithCarouselResponse: VFC;
@@ -0,0 +1 @@
1
+ export { SearchWidget, SearchWidgetProps } from "./SearchWidget";
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { FormHeaderItem } from '../SearchResponseFormDisplay';
3
+ interface SimpleNavigationHeaderProps {
4
+ items: FormHeaderItem[];
5
+ onHeaderClick(step: string): void;
6
+ }
7
+ export declare const SimpleNavigationHeader: React.FC<SimpleNavigationHeaderProps>;
8
+ export {};
@@ -0,0 +1 @@
1
+ export { SimpleNavigationHeader } from "./SimpleNavigationHeader";
@@ -0,0 +1,9 @@
1
+ import { FC } from "react";
2
+ import { SuggestionTypes } from "stentor-models";
3
+ import "./SuggestedAction.scss";
4
+ export interface SuggestedActionProps {
5
+ readonly action: SuggestionTypes;
6
+ onClick(action: SuggestionTypes): void;
7
+ readonly className?: string;
8
+ }
9
+ export declare const SuggestedAction: FC<SuggestedActionProps>;
@@ -0,0 +1,7 @@
1
+ import { Meta } from "@storybook/react/types-6-0";
2
+ import { VFC } from "react";
3
+ declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
+ export default _default;
5
+ export declare const TextAction: VFC;
6
+ export declare const LinkAction: VFC;
7
+ export declare const ObjAction: VFC;
@@ -0,0 +1 @@
1
+ export { SuggestedAction, SuggestedActionProps } from "./SuggestedAction";
@@ -0,0 +1,9 @@
1
+ import { FC } from "react";
2
+ import { SuggestionTypes } from "stentor-models";
3
+ import "./SuggestedActions.scss";
4
+ import "@xapp/chat-widget-core/dist/index.css";
5
+ export interface SuggestedActionsProps {
6
+ readonly actions: readonly SuggestionTypes[];
7
+ onActionClick(action: SuggestionTypes): void;
8
+ }
9
+ export declare const SuggestedActions: FC<SuggestedActionsProps>;
@@ -0,0 +1,5 @@
1
+ import { Meta } from "@storybook/react/types-6-0";
2
+ import { VFC } from "react";
3
+ declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
+ export default _default;
5
+ export declare const Default: VFC;
@@ -0,0 +1 @@
1
+ export { SuggestedActions, SuggestedActionsProps } from "./SuggestedActions";
@@ -0,0 +1,2 @@
1
+ import { VFC } from "react";
2
+ export declare const UnknownMessage: VFC;
@@ -0,0 +1 @@
1
+ export { UnknownMessage } from "./UnknownMessage";
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ import { SearchWidgetTheme } from "../../config/theme";
3
+ export interface WidgetStylesheetProps {
4
+ readonly theme?: SearchWidgetTheme;
5
+ }
6
+ export declare function buildStyleContent(theme?: SearchWidgetTheme): string;
7
+ export declare const WidgetStylesheet: FC<WidgetStylesheetProps>;
@@ -0,0 +1 @@
1
+ export { WidgetStylesheet, WidgetStylesheetProps } from "./WidgetStylesheet";
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ import "./BigMicIcon.scss";
3
+ export interface BigMicIconProps {
4
+ readonly isPulsating: boolean;
5
+ }
6
+ export declare const BigMicIcon: FC<BigMicIconProps>;
@@ -0,0 +1 @@
1
+ export { BigMicIcon } from "./BigMicIcon";
@@ -0,0 +1,5 @@
1
+ import { Meta } from "@storybook/react/types-6-0";
2
+ import { VFC } from "react";
3
+ declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
4
+ export default _default;
5
+ export declare const Default: VFC;
@@ -0,0 +1,2 @@
1
+ import { VFC } from "react";
2
+ export declare const LeftAngleIcon: VFC;
@@ -0,0 +1 @@
1
+ export { LeftAngleIcon } from "./LeftAngleIcon";
@@ -0,0 +1,2 @@
1
+ import { VFC } from "react";
2
+ export declare const MicIconEmpty: VFC;
@@ -0,0 +1,2 @@
1
+ import { VFC } from "react";
2
+ export declare const MicIconFill: VFC;
@@ -0,0 +1,2 @@
1
+ export { MicIconFill } from "./MicIconFill";
2
+ export { MicIconEmpty } from "./MicIconEmpty";
@@ -0,0 +1,2 @@
1
+ import { VFC } from "react";
2
+ export declare const RightAngleIcon: VFC;
@@ -0,0 +1 @@
1
+ export { RightAngleIcon } from "./RightAngleIcon";
@@ -0,0 +1,2 @@
1
+ import { VFC } from "react";
2
+ export declare const SearchIcon: VFC;
@@ -0,0 +1 @@
1
+ export { SearchIcon } from "./SearchIcon";
@@ -0,0 +1,2 @@
1
+ import { VFC } from "react";
2
+ export declare const SpinnerIcon: VFC;
@@ -0,0 +1 @@
1
+ export { SpinnerIcon } from "./SpinnerIcon";
@@ -0,0 +1,4 @@
1
+ export { LeftAngleIcon } from "./LeftAngleIcon";
2
+ export { RightAngleIcon } from "./RightAngleIcon";
3
+ export { SearchIcon } from "./SearchIcon";
4
+ export { SpinnerIcon } from "./SpinnerIcon";
@@ -0,0 +1,2 @@
1
+ export { Search, SearchContainer, SearchProps } from "./Search";
2
+ export { SearchWidget, SearchWidgetProps } from "./SearchWidget";
@@ -0,0 +1,8 @@
1
+ export declare function getBasePathFromWidgetSource(): {
2
+ path: string;
3
+ key?: string;
4
+ };
5
+ export declare function getBasePath(path?: string): {
6
+ path: string;
7
+ key?: string;
8
+ };
@@ -0,0 +1,2 @@
1
+ export { SearchWidgetConfig, StentorApiConfig } from "./search-config";
2
+ export { SearchWidgetTheme } from "./theme";
@@ -0,0 +1,10 @@
1
+ export interface SearchWidgetConfig {
2
+ readonly api: StentorApiConfig;
3
+ readonly suggestionsUrl?: string;
4
+ readonly isVoiceEnabled?: boolean;
5
+ readonly autoGreeting?: string;
6
+ }
7
+ export interface StentorApiConfig {
8
+ readonly url: string;
9
+ readonly key: string;
10
+ }
@@ -0,0 +1,76 @@
1
+ export interface SearchWidgetTheme {
2
+ readonly accentColor?: string;
3
+ readonly border?: WidgetBorderTheme;
4
+ readonly messages?: WidgetMessagesTheme;
5
+ readonly card?: WidgetCardTheme;
6
+ readonly carousel?: WidgetCarouselTheme;
7
+ readonly list?: WidgetCarouselTheme;
8
+ }
9
+ export interface WidgetLinkTheme {
10
+ readonly default?: WidgetTextTheme;
11
+ }
12
+ export declare type WidgetBorderStyle = "solid" | "dashed" | "none";
13
+ export interface WidgetBorderTheme {
14
+ readonly color?: string;
15
+ readonly width?: string;
16
+ readonly radius?: string;
17
+ readonly style?: WidgetBorderStyle;
18
+ }
19
+ export interface WidgetPaddingTheme {
20
+ readonly top?: string;
21
+ readonly right?: string;
22
+ readonly bottom?: string;
23
+ readonly left?: string;
24
+ }
25
+ export interface WidgetMarginTheme {
26
+ readonly top?: string;
27
+ readonly right?: string;
28
+ readonly bottom?: string;
29
+ readonly left?: string;
30
+ }
31
+ export declare type WidgetBackgroundTheme = string;
32
+ export interface WidgetMessagesTheme {
33
+ readonly others?: WidgetMessageTheme;
34
+ }
35
+ export interface WidgetBubbleTheme {
36
+ readonly background?: WidgetBackgroundTheme;
37
+ }
38
+ export interface WidgetMessageTheme {
39
+ /** Message bubble color */
40
+ readonly bubble?: WidgetBubbleTheme;
41
+ /** Message text color */
42
+ readonly text?: WidgetTextTheme;
43
+ }
44
+ export interface WidgetTextTheme {
45
+ readonly color?: string;
46
+ readonly fontSize?: string;
47
+ readonly fontFamily?: string;
48
+ readonly fontWeight?: string;
49
+ readonly fontStyle?: string;
50
+ readonly lineHeight?: string | number;
51
+ }
52
+ export interface WidgetTextBlockTheme {
53
+ readonly text?: WidgetTextTheme;
54
+ readonly margin?: WidgetMarginTheme;
55
+ readonly padding?: WidgetMarginTheme;
56
+ }
57
+ export interface WidgetLinkBlockTheme {
58
+ readonly text?: WidgetLinkTheme;
59
+ readonly margin?: WidgetMarginTheme;
60
+ readonly padding?: WidgetMarginTheme;
61
+ }
62
+ export interface WidgetCardTheme {
63
+ readonly border?: WidgetBorderTheme;
64
+ readonly background?: WidgetBackgroundTheme;
65
+ readonly title?: WidgetTextBlockTheme;
66
+ readonly description?: WidgetTextBlockTheme;
67
+ readonly link?: WidgetLinkBlockTheme;
68
+ readonly padding?: WidgetPaddingTheme;
69
+ readonly margin?: WidgetMarginTheme;
70
+ }
71
+ export interface WidgetListTheme {
72
+ readonly card?: WidgetCardTheme;
73
+ }
74
+ export interface WidgetCarouselTheme {
75
+ readonly card?: WidgetCardTheme;
76
+ }
@@ -0,0 +1,3 @@
1
+ export declare enum classNames {
2
+ XAPP_SEARCH_BUTTON = "xapp-search-button"
3
+ }