odaptos_design_system 2.0.97 → 2.0.99

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.
@@ -1,7 +1,7 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
2
  export interface ControlsBarProps extends HTMLAttributes<HTMLDivElement> {
3
3
  className?: string;
4
- isInterviewer?: boolean;
4
+ identity?: 'observer' | 'interviewer' | 'interviewee';
5
5
  endInterview?: () => void;
6
6
  enableScreenSharing?: () => void;
7
7
  enableMicrophone?: () => void;
@@ -34,5 +34,8 @@ export interface ControlsBarProps extends HTMLAttributes<HTMLDivElement> {
34
34
  stopRecPopoverBtnTwoOnClick?: () => void;
35
35
  stopRecText: string;
36
36
  startRecText: string;
37
+ exitInterview?: () => void;
38
+ exitInterviewText?: string;
39
+ disabledExitInterview?: boolean;
37
40
  }
38
- export declare const ControlsBar: ({ className, isInterviewer, endInterview, enableScreenSharing, enableMicrophone, muteMicrophone, enableCamera, muteCamera, displayChat, displayTasks, startRecording, isChatOpen, areTasksOpen, isNewTask, isNewMessage, isMicrophoneActive, isCameraActive, isRecording, screenShareText, disabledRecording, disabledEndInterview, myTasksText, protocolText, isModerated, endInterviewText, stopRecPopoverTitle, stopRecPopoverDescription, stopRecPopoverBtnOneText, stopRecPopoverBtnTwoText, isRecordingBtnDisplay, stopRecPopoverBtnOneOnClick, stopRecPopoverBtnTwoOnClick, stopRecText, startRecText, ...props }: ControlsBarProps) => React.JSX.Element;
41
+ export declare const ControlsBar: ({ className, identity, endInterview, enableScreenSharing, enableMicrophone, muteMicrophone, enableCamera, muteCamera, displayChat, displayTasks, startRecording, isChatOpen, areTasksOpen, isNewTask, isNewMessage, isMicrophoneActive, isCameraActive, isRecording, screenShareText, disabledRecording, disabledEndInterview, myTasksText, protocolText, isModerated, endInterviewText, stopRecPopoverTitle, stopRecPopoverDescription, stopRecPopoverBtnOneText, stopRecPopoverBtnTwoText, isRecordingBtnDisplay, stopRecPopoverBtnOneOnClick, stopRecPopoverBtnTwoOnClick, stopRecText, startRecText, exitInterview, exitInterviewText, disabledExitInterview, ...props }: ControlsBarProps) => React.JSX.Element;
@@ -12738,13 +12738,13 @@ const CircledIconButton = ({
12738
12738
  }));
12739
12739
  };
12740
12740
 
12741
- var css_248z$p = ".ControlsBar-modules_control_bar__ft1eh{align-items:center;display:inline-flex;gap:.5rem}.ControlsBar-modules_control_bar__ft1eh .ControlsBar-modules_separator__0fqPr{background:var(--color-neutral-dark-shades-700,#64666a);height:1rem;width:.0625rem}.ControlsBar-modules_control_bar__ft1eh .ControlsBar-modules_record_btn__DLwh8{align-items:center;background:var(--Color-Extended-Red-50,#fff6f6);border:none;border-radius:1.5rem;box-shadow:0 4px 8px 3px rgba(0,0,0,.08),0 1px 3px 0 rgba(0,0,0,.15);cursor:pointer;display:flex;gap:.5rem;padding:.5rem .75rem .5rem .5rem}.ControlsBar-modules_control_bar__ft1eh .ControlsBar-modules_record_btn__DLwh8:hover{background:var(--Color-Neutral-Basics-White,#fff)}.ControlsBar-modules_control_bar__ft1eh .ControlsBar-modules_record_btn__DLwh8:active{background:var(--Color-Extended-Red-100,#fddbdb)}.ControlsBar-modules_control_bar__ft1eh .ControlsBar-modules_record_btn__DLwh8:disabled{cursor:not-allowed}.ControlsBar-modules_control_bar__ft1eh .ControlsBar-modules_record_btn__DLwh8:disabled:active,.ControlsBar-modules_control_bar__ft1eh .ControlsBar-modules_record_btn__DLwh8:disabled:hover{background:var(--Color-Extended-Red-50,#fff6f6)}.ControlsBar-modules_chatBubbleIcon__vCKpm svg{fill:transparent!important}.ControlsBar-modules_stop_rec_popover__3zCEy{display:flex;flex-direction:column;padding:1rem;width:-moz-min-content;width:min-content}.ControlsBar-modules_stop_rec_popover_actions__GxI-F{display:flex;gap:.5rem;margin-top:.5rem;width:-moz-max-content;width:max-content}";
12742
- var styles$p = {"control_bar":"ControlsBar-modules_control_bar__ft1eh","separator":"ControlsBar-modules_separator__0fqPr","record_btn":"ControlsBar-modules_record_btn__DLwh8","chatBubbleIcon":"ControlsBar-modules_chatBubbleIcon__vCKpm","stop_rec_popover":"ControlsBar-modules_stop_rec_popover__3zCEy","stop_rec_popover_actions":"ControlsBar-modules_stop_rec_popover_actions__GxI-F"};
12741
+ var css_248z$p = ".ControlsBar-modules_control_bar__ft1eh{align-items:center;display:inline-flex;gap:.5rem}.ControlsBar-modules_control_bar__ft1eh .ControlsBar-modules_separator__0fqPr{background:var(--color-neutral-dark-shades-700,#64666a);height:1rem;width:.0625rem}.ControlsBar-modules_control_bar__ft1eh .ControlsBar-modules_observer_count__n86ih{align-items:center;display:flex;gap:.5rem}.ControlsBar-modules_control_bar__ft1eh .ControlsBar-modules_record_btn__DLwh8{align-items:center;background:var(--Color-Extended-Red-50,#fff6f6);border:none;border-radius:1.5rem;box-shadow:0 4px 8px 3px rgba(0,0,0,.08),0 1px 3px 0 rgba(0,0,0,.15);cursor:pointer;display:flex;gap:.5rem;padding:.5rem .75rem .5rem .5rem}.ControlsBar-modules_control_bar__ft1eh .ControlsBar-modules_record_btn__DLwh8:hover{background:var(--Color-Neutral-Basics-White,#fff)}.ControlsBar-modules_control_bar__ft1eh .ControlsBar-modules_record_btn__DLwh8:active{background:var(--Color-Extended-Red-100,#fddbdb)}.ControlsBar-modules_control_bar__ft1eh .ControlsBar-modules_record_btn__DLwh8:disabled{cursor:not-allowed}.ControlsBar-modules_control_bar__ft1eh .ControlsBar-modules_record_btn__DLwh8:disabled:active,.ControlsBar-modules_control_bar__ft1eh .ControlsBar-modules_record_btn__DLwh8:disabled:hover{background:var(--Color-Extended-Red-50,#fff6f6)}.ControlsBar-modules_chatBubbleIcon__vCKpm svg{fill:transparent!important}.ControlsBar-modules_stop_rec_popover__3zCEy{display:flex;flex-direction:column;padding:1rem;width:-moz-min-content;width:min-content}.ControlsBar-modules_stop_rec_popover_actions__GxI-F{display:flex;gap:.5rem;margin-top:.5rem;width:-moz-max-content;width:max-content}";
12742
+ var styles$p = {"control_bar":"ControlsBar-modules_control_bar__ft1eh","separator":"ControlsBar-modules_separator__0fqPr","observer_count":"ControlsBar-modules_observer_count__n86ih","record_btn":"ControlsBar-modules_record_btn__DLwh8","chatBubbleIcon":"ControlsBar-modules_chatBubbleIcon__vCKpm","stop_rec_popover":"ControlsBar-modules_stop_rec_popover__3zCEy","stop_rec_popover_actions":"ControlsBar-modules_stop_rec_popover_actions__GxI-F"};
12743
12743
  styleInject(css_248z$p);
12744
12744
 
12745
12745
  const ControlsBar = ({
12746
12746
  className,
12747
- isInterviewer,
12747
+ identity,
12748
12748
  endInterview,
12749
12749
  enableScreenSharing,
12750
12750
  enableMicrophone,
@@ -12777,11 +12777,24 @@ const ControlsBar = ({
12777
12777
  stopRecPopoverBtnTwoOnClick,
12778
12778
  stopRecText,
12779
12779
  startRecText,
12780
+ exitInterview,
12781
+ exitInterviewText,
12782
+ disabledExitInterview,
12780
12783
  ...props
12781
12784
  }) => {
12782
12785
  const [isStopRecPopoverOpen, setIsStopRecPopoverOpen] = React.useState(false);
12783
12786
  const [anchorEl, setAnchorEl] = React.useState(null);
12784
- return /*#__PURE__*/React__default.createElement("div", Object.assign({
12787
+ if (identity === 'observer') {
12788
+ return /*#__PURE__*/React__default.createElement("div", Object.assign({
12789
+ className: `${styles$p.control_bar} ${className ?? ''}`
12790
+ }, props), exitInterview && exitInterviewText && /*#__PURE__*/React__default.createElement(InterviewButton, {
12791
+ text: exitInterviewText,
12792
+ variant: "end-interview",
12793
+ disabled: disabledExitInterview,
12794
+ onClick: () => exitInterview(),
12795
+ icon: /*#__PURE__*/React__default.createElement(HangUpIcon, null)
12796
+ }));
12797
+ } else return /*#__PURE__*/React__default.createElement("div", Object.assign({
12785
12798
  className: `${styles$p.control_bar} ${className ?? ''}`
12786
12799
  }, props), enableMicrophone && /*#__PURE__*/React__default.createElement(CircledIconButton, {
12787
12800
  icon: isMicrophoneActive ? /*#__PURE__*/React__default.createElement(MicrophoneIcon, null) : /*#__PURE__*/React__default.createElement(NoMicrophoneIcon, null),
@@ -12799,7 +12812,7 @@ const ControlsBar = ({
12799
12812
  }
12800
12813
  }), /*#__PURE__*/React__default.createElement("div", {
12801
12814
  className: styles$p.separator
12802
- }), isInterviewer && isRecordingBtnDisplay && isModerated && /*#__PURE__*/React__default.createElement("button", {
12815
+ }), identity === 'interviewer' && isRecordingBtnDisplay && isModerated && /*#__PURE__*/React__default.createElement("button", {
12803
12816
  ref: setAnchorEl,
12804
12817
  disabled: disabledRecording,
12805
12818
  className: styles$p.record_btn,
@@ -12816,13 +12829,13 @@ const ControlsBar = ({
12816
12829
  }), /*#__PURE__*/React__default.createElement(Text, {
12817
12830
  weight: "semi-bold",
12818
12831
  text: isRecording ? stopRecText : startRecText
12819
- })), isInterviewer && endInterview && /*#__PURE__*/React__default.createElement(InterviewButton, {
12832
+ })), identity === 'interviewer' && endInterview && /*#__PURE__*/React__default.createElement(InterviewButton, {
12820
12833
  text: endInterviewText,
12821
12834
  variant: "end-interview",
12822
12835
  disabled: disabledEndInterview,
12823
12836
  onClick: () => endInterview(),
12824
12837
  icon: /*#__PURE__*/React__default.createElement(HangUpIcon, null)
12825
- }), (!isInterviewer || !isModerated) && screenShareText && enableScreenSharing && /*#__PURE__*/React__default.createElement(InterviewButton, {
12838
+ }), (identity === 'interviewee' || !isModerated) && screenShareText && enableScreenSharing && /*#__PURE__*/React__default.createElement(InterviewButton, {
12826
12839
  id: "odaptos_screen_share",
12827
12840
  text: screenShareText,
12828
12841
  variant: "screenshare",
@@ -12830,7 +12843,7 @@ const ControlsBar = ({
12830
12843
  onClick: () => enableScreenSharing()
12831
12844
  }), isModerated && /*#__PURE__*/React__default.createElement("div", {
12832
12845
  className: styles$p.separator
12833
- }), isModerated && isInterviewer ? /*#__PURE__*/React__default.createElement(InterviewButton, {
12846
+ }), isModerated && identity === 'interviewer' ? /*#__PURE__*/React__default.createElement(InterviewButton, {
12834
12847
  text: protocolText,
12835
12848
  variant: "protocol",
12836
12849
  icon: /*#__PURE__*/React__default.createElement(TaskIcon, {