@nlxai/touchpoint-ui 1.2.3 → 1.2.4-alpha.1

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/index.html CHANGED
@@ -32,17 +32,17 @@
32
32
  languageCode: "en-US",
33
33
  },
34
34
  windowSize: "full",
35
- colorMode: "light dark",
35
+ // colorMode: "light dark",
36
36
  // userMessageBubble: true,
37
37
  // agentMessageBubble: true,
38
38
  // chatMode: true,
39
- theme: {
40
- accent: "rgba(255, 253, 114, 1)",
41
- primary80:
42
- "light-dark(rgba(12, 12, 200, 0.8), rgba(255, 255, 255, 0.85))",
39
+ // theme: {
40
+ // accent: "rgba(255, 253, 114, 1)",
41
+ // primary80:
42
+ // "light-dark(rgba(12, 12, 200, 0.8), rgba(255, 255, 255, 0.85))",
43
43
 
44
- fontFamily: "'BW Haas Text Mono C 55 Rom Regular', monospace",
45
- },
44
+ // fontFamily: "'BW Haas Text Mono C 55 Rom Regular', monospace",
45
+ // },
46
46
  });
47
47
  </script>
48
48
  </body>
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ import type * as Feedback from "../feedback";
3
+ export declare const FeedbackComment: FC<{
4
+ feedbackState: Feedback.State;
5
+ feedbackActions: Feedback.Actions;
6
+ }>;
@@ -1,6 +1,7 @@
1
1
  import { FC } from 'react';
2
2
  import { Response, ConversationHandler, ApplicationMessage } from '@nlxai/core';
3
3
  import { CustomModalityComponent, ColorMode } from '../interface';
4
+ import * as Feedback from "../feedback";
4
5
  export interface MessagesProps {
5
6
  isWaiting: boolean;
6
7
  handler: ConversationHandler;
@@ -14,6 +15,8 @@ export interface MessagesProps {
14
15
  modalityComponents: Record<string, CustomModalityComponent<unknown>>;
15
16
  className?: string;
16
17
  enabled: boolean;
18
+ feedbackState: Feedback.State;
19
+ feedbackActions: Feedback.Actions;
17
20
  }
18
21
  export declare const MessageChoices: FC<{
19
22
  handler: ConversationHandler;
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import { MouseEventHandler, FC } from 'react';
2
2
  import { IconProps } from './Icons';
3
3
  /**
4
4
  * Represents the different types of icon buttons available in the application.
@@ -20,7 +20,7 @@ export interface IconButtonProps {
20
20
  /**
21
21
  * Handler function called when the button is clicked
22
22
  */
23
- onClick?: () => void;
23
+ onClick?: MouseEventHandler<HTMLButtonElement>;
24
24
  /**
25
25
  * Accessible label for the button
26
26
  */
@@ -26,12 +26,14 @@ export declare const ArrowRight: Icon;
26
26
  export declare const ArrowUp: Icon;
27
27
  export declare const ArrowForward: Icon;
28
28
  export declare const Attachment: Icon;
29
+ export declare const BotMessage: Icon;
29
30
  export declare const Camera: Icon;
30
31
  export declare const Check: Icon;
31
32
  export declare const Close: Icon;
32
33
  export declare const Copy: Icon;
33
34
  export declare const Date: Icon;
34
35
  export declare const Delete: Icon;
36
+ export declare const Edit: Icon;
35
37
  export declare const Escalate: Icon;
36
38
  export declare const Error: Icon;
37
39
  export declare const FullScreen: Icon;
@@ -0,0 +1,58 @@
1
+ import { FC } from 'react';
2
+ import { IconProps } from './Icons';
3
+ /**
4
+ * Represents the different types of icon buttons available in the application.
5
+ *
6
+ * - `main`: The primary icon button.
7
+ * - `ghost`: A transparent or less prominent icon button.
8
+ * - `activated`: An icon button that indicates an active state.
9
+ * - `coverup`: An icon button used to cover up or mask something.
10
+ * - `overlay`: An icon button that appears over other content.
11
+ * @category Modality components
12
+ */
13
+ export type MessageButtonType = "main" | "activated";
14
+ /**
15
+ * Props for the MessageButton component
16
+ * @inline
17
+ * @hidden
18
+ */
19
+ export interface MessageButtonProps {
20
+ /**
21
+ * Handler function called when the button is clicked
22
+ */
23
+ onClick?: () => void;
24
+ /**
25
+ * Accessible label for the button
26
+ */
27
+ label: string;
28
+ /**
29
+ * Additional CSS classes to apply to the button
30
+ */
31
+ className?: string;
32
+ /**
33
+ * Visual style variant of the button. One of MessageButtonType.
34
+ */
35
+ type: MessageButtonType;
36
+ /**
37
+ * Icon component to display inside the button
38
+ */
39
+ Icon: FC<IconProps>;
40
+ }
41
+ /**
42
+ * A button showing only an icon (textual label is provided for accessibility)
43
+ * @example
44
+ * ```tsx
45
+ * import { MessageButton, Icons, React } from '@nlx/touchpoint-ui';
46
+ *
47
+ * const MyMessageButton = () => (
48
+ * <MessageButton
49
+ * label="Send message"
50
+ * onClick={() => alert('Icon button clicked!')}
51
+ * type="main"
52
+ * Icon={Icons.ArrowForward}
53
+ * />
54
+ * );
55
+ * ```
56
+ * @category Modality components
57
+ */
58
+ export declare const MessageButton: FC<MessageButtonProps>;
@@ -0,0 +1,40 @@
1
+ import { ConversationHandler } from '@nlxai/core';
2
+ interface FeedbackInfo {
3
+ rating: number | null;
4
+ commentSubmitted: boolean;
5
+ commentText: string;
6
+ }
7
+ export interface State {
8
+ comment: CommentState;
9
+ items: Record<string, FeedbackInfo>;
10
+ }
11
+ type CommentState = {
12
+ state: "idle";
13
+ } | {
14
+ state: "editing";
15
+ activeFeedbackUrl: string;
16
+ text: string;
17
+ } | {
18
+ state: "submitting";
19
+ activeFeedbackUrl: string;
20
+ text: string;
21
+ } | {
22
+ state: "submitted";
23
+ activeFeedbackUrl: string;
24
+ text: string;
25
+ } | {
26
+ state: "error";
27
+ activeFeedbackUrl: string;
28
+ text: string;
29
+ };
30
+ export declare const getFeedbackInfo: (state: State, feedbackUrl: string) => FeedbackInfo;
31
+ export interface Actions {
32
+ clickRating: (feedbackUrl: string, value: number) => void;
33
+ clickCommentButton: (feedbackUrl: string) => void;
34
+ clickCommentEdit: () => void;
35
+ editCommentText: (text: string) => void;
36
+ submitComment: () => Promise<void>;
37
+ cancelComment: () => void;
38
+ }
39
+ export declare function useFeedback(handler: ConversationHandler): [State, Actions];
40
+ export {};