@microsoft/omnichannel-chat-components 1.1.13 → 1.1.15

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 (67) hide show
  1. package/lib/cjs/common/Constants.js +1 -0
  2. package/lib/cjs/components/citationpane/CitationPane.js +154 -0
  3. package/lib/cjs/components/citationpane/ScalingTest.js +77 -0
  4. package/lib/cjs/components/citationpane/common/defaultProps/defaultCitationPaneControlProps.js +22 -0
  5. package/lib/cjs/components/citationpane/common/defaultProps/defaultCitationPaneProps.js +16 -0
  6. package/lib/cjs/components/citationpane/common/defaultProps/defaultCitationPaneStyleProps.js +37 -0
  7. package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneCloseButtonFocusedStyles.js +11 -0
  8. package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneCloseButtonHoveredStyles.js +11 -0
  9. package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneCloseButtonStyles.js +49 -0
  10. package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneContentStyles.js +21 -0
  11. package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneGeneralStyles.js +33 -0
  12. package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneStyles.js +37 -0
  13. package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneTitleStyles.js +8 -0
  14. package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneTopCloseButtonFocusedStyles.js +11 -0
  15. package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneTopCloseButtonHoveredStyles.js +11 -0
  16. package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneTopCloseButtonStyles.js +43 -0
  17. package/lib/cjs/components/citationpane/interfaces/ICitationPaneClassNames.js +1 -0
  18. package/lib/cjs/components/citationpane/interfaces/ICitationPaneComponentOverrides.js +1 -0
  19. package/lib/cjs/components/citationpane/interfaces/ICitationPaneControlProps.js +1 -0
  20. package/lib/cjs/components/citationpane/interfaces/ICitationPaneProps.js +1 -0
  21. package/lib/cjs/components/citationpane/interfaces/ICitationPaneStyleProps.js +1 -0
  22. package/lib/cjs/index.js +8 -0
  23. package/lib/esm/common/Constants.js +1 -0
  24. package/lib/esm/components/citationpane/CitationPane.js +124 -0
  25. package/lib/esm/components/citationpane/ScalingTest.js +64 -0
  26. package/lib/esm/components/citationpane/common/defaultProps/defaultCitationPaneControlProps.js +15 -0
  27. package/lib/esm/components/citationpane/common/defaultProps/defaultCitationPaneProps.js +6 -0
  28. package/lib/esm/components/citationpane/common/defaultProps/defaultCitationPaneStyleProps.js +20 -0
  29. package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneCloseButtonFocusedStyles.js +4 -0
  30. package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneCloseButtonHoveredStyles.js +4 -0
  31. package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneCloseButtonStyles.js +42 -0
  32. package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneContentStyles.js +14 -0
  33. package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneGeneralStyles.js +26 -0
  34. package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneStyles.js +20 -0
  35. package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneTitleStyles.js +1 -0
  36. package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneTopCloseButtonFocusedStyles.js +4 -0
  37. package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneTopCloseButtonHoveredStyles.js +4 -0
  38. package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneTopCloseButtonStyles.js +36 -0
  39. package/lib/esm/components/citationpane/interfaces/ICitationPaneClassNames.js +1 -0
  40. package/lib/esm/components/citationpane/interfaces/ICitationPaneComponentOverrides.js +1 -0
  41. package/lib/esm/components/citationpane/interfaces/ICitationPaneControlProps.js +1 -0
  42. package/lib/esm/components/citationpane/interfaces/ICitationPaneProps.js +1 -0
  43. package/lib/esm/components/citationpane/interfaces/ICitationPaneStyleProps.js +1 -0
  44. package/lib/esm/index.js +1 -0
  45. package/lib/types/common/Constants.d.ts +1 -0
  46. package/lib/types/components/citationpane/CitationPane.d.ts +4 -0
  47. package/lib/types/components/citationpane/ScalingTest.d.ts +7 -0
  48. package/lib/types/components/citationpane/common/defaultProps/defaultCitationPaneControlProps.d.ts +2 -0
  49. package/lib/types/components/citationpane/common/defaultProps/defaultCitationPaneProps.d.ts +2 -0
  50. package/lib/types/components/citationpane/common/defaultProps/defaultCitationPaneStyleProps.d.ts +2 -0
  51. package/lib/types/components/citationpane/common/defaultStyles/defaultCitationPaneCloseButtonFocusedStyles.d.ts +2 -0
  52. package/lib/types/components/citationpane/common/defaultStyles/defaultCitationPaneCloseButtonHoveredStyles.d.ts +2 -0
  53. package/lib/types/components/citationpane/common/defaultStyles/defaultCitationPaneCloseButtonStyles.d.ts +2 -0
  54. package/lib/types/components/citationpane/common/defaultStyles/defaultCitationPaneContentStyles.d.ts +2 -0
  55. package/lib/types/components/citationpane/common/defaultStyles/defaultCitationPaneGeneralStyles.d.ts +2 -0
  56. package/lib/types/components/citationpane/common/defaultStyles/defaultCitationPaneStyles.d.ts +2 -0
  57. package/lib/types/components/citationpane/common/defaultStyles/defaultCitationPaneTitleStyles.d.ts +2 -0
  58. package/lib/types/components/citationpane/common/defaultStyles/defaultCitationPaneTopCloseButtonFocusedStyles.d.ts +2 -0
  59. package/lib/types/components/citationpane/common/defaultStyles/defaultCitationPaneTopCloseButtonHoveredStyles.d.ts +2 -0
  60. package/lib/types/components/citationpane/common/defaultStyles/defaultCitationPaneTopCloseButtonStyles.d.ts +2 -0
  61. package/lib/types/components/citationpane/interfaces/ICitationPaneClassNames.d.ts +7 -0
  62. package/lib/types/components/citationpane/interfaces/ICitationPaneComponentOverrides.d.ts +6 -0
  63. package/lib/types/components/citationpane/interfaces/ICitationPaneControlProps.d.ts +16 -0
  64. package/lib/types/components/citationpane/interfaces/ICitationPaneProps.d.ts +8 -0
  65. package/lib/types/components/citationpane/interfaces/ICitationPaneStyleProps.d.ts +14 -0
  66. package/lib/types/index.d.ts +1 -0
  67. package/package.json +1 -1
@@ -42,6 +42,7 @@ exports.ElementType = ElementType;
42
42
  ElementType["ReconnectChatPane"] = "ReconnectChatPane";
43
43
  ElementType["ConfirmationPaneConfirmButton"] = "ConfirmationPaneConfirmButton";
44
44
  ElementType["ConfirmationPaneCancelButton"] = "ConfirmationPaneCancelButton";
45
+ ElementType["CitationPaneCloseButton"] = "CitationPaneCloseButton";
45
46
  ElementType["PreChatSurveySubmitButton"] = "PreChatSurveySubmitButton";
46
47
  ElementType["PreChatSurveyError"] = "PreChatSurveyError";
47
48
  ElementType["IncomingCallDeclineCallButton"] = "IncomingCallDeclineCallButton";
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = require("@fluentui/react");
9
+
10
+ var _Constants = require("../../common/Constants");
11
+
12
+ var _react2 = _interopRequireWildcard(require("react"));
13
+
14
+ var _BroadcastService = require("../../services/BroadcastService");
15
+
16
+ var _decodeComponentString = require("../../common/decodeComponentString");
17
+
18
+ var _defaultCitationPaneCloseButtonFocusedStyles = require("./common/defaultStyles/defaultCitationPaneCloseButtonFocusedStyles");
19
+
20
+ var _defaultCitationPaneCloseButtonHoveredStyles = require("./common/defaultStyles/defaultCitationPaneCloseButtonHoveredStyles");
21
+
22
+ var _defaultCitationPaneCloseButtonStyles = require("./common/defaultStyles/defaultCitationPaneCloseButtonStyles");
23
+
24
+ var _defaultCitationPaneContentStyles = require("./common/defaultStyles/defaultCitationPaneContentStyles");
25
+
26
+ var _defaultCitationPaneControlProps = require("./common/defaultProps/defaultCitationPaneControlProps");
27
+
28
+ var _defaultCitationPaneGeneralStyles = require("./common/defaultStyles/defaultCitationPaneGeneralStyles");
29
+
30
+ var _defaultCitationPaneTitleStyles = require("./common/defaultStyles/defaultCitationPaneTitleStyles");
31
+
32
+ var _defaultCitationPaneTopCloseButtonFocusedStyles = require("./common/defaultStyles/defaultCitationPaneTopCloseButtonFocusedStyles");
33
+
34
+ var _defaultCitationPaneTopCloseButtonHoveredStyles = require("./common/defaultStyles/defaultCitationPaneTopCloseButtonHoveredStyles");
35
+
36
+ var _defaultCitationPaneTopCloseButtonStyles = require("./common/defaultStyles/defaultCitationPaneTopCloseButtonStyles");
37
+
38
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
39
+
40
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
41
+
42
+ function CitationPane(props) {
43
+ var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$controlProps4, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$styleProps11, _props$controlProps5, _props$styleProps12, _props$styleProps12$c, _props$controlProps6, _props$componentOverr, _props$controlProps7, _props$styleProps13, _props$styleProps13$c, _props$controlProps8, _props$componentOverr2, _props$styleProps14, _props$styleProps14$c, _props$controlProps9, _props$styleProps15, _props$styleProps15$c, _props$controlProps10, _props$controlProps11, _props$componentOverr3, _props$controlProps12, _props$controlProps13, _props$styleProps16, _props$styleProps16$c;
44
+
45
+ const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? _defaultCitationPaneControlProps.defaultCitationPaneControlProps.id;
46
+ const handleClose = (0, _react2.useCallback)(() => {
47
+ var _props$controlProps2;
48
+
49
+ if ((_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.onClose) {
50
+ var _props$controlProps3;
51
+
52
+ const customEvent = {
53
+ elementType: _Constants.ElementType.CitationPaneCloseButton,
54
+ elementId: elementId + "-close",
55
+ eventName: _Constants.EventNames.OnClick
56
+ };
57
+
58
+ _BroadcastService.BroadcastService.postMessage(customEvent);
59
+
60
+ (_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.onClose();
61
+ }
62
+ }, [props.controlProps, elementId]);
63
+ const handleTopClose = (0, _react2.useCallback)(() => {
64
+ if (handleClose) {
65
+ const customEvent = {
66
+ elementType: _Constants.ElementType.CitationPaneCloseButton,
67
+ elementId: elementId + "-top-close",
68
+ eventName: _Constants.EventNames.OnClick
69
+ };
70
+
71
+ _BroadcastService.BroadcastService.postMessage(customEvent);
72
+
73
+ handleClose();
74
+ }
75
+ }, [props.controlProps, elementId]); // eslint-disable-next-line @typescript-eslint/no-explicit-any
76
+
77
+ const handleEscKeyDown = (0, _react2.useCallback)(e => {
78
+ if (e.key === "Escape") {
79
+ handleClose();
80
+ }
81
+ }, [handleClose]);
82
+ const containerStyles = {
83
+ root: Object.assign({}, _defaultCitationPaneGeneralStyles.defaultCitationPaneGeneralStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps, {
84
+ position: "relative" // Ensure container is positioned for absolute positioning of top close button
85
+
86
+ })
87
+ };
88
+ const titleStyles = {
89
+ root: Object.assign({}, _defaultCitationPaneTitleStyles.defaultCitationPaneTitleStyles, (_props$styleProps2 = props.styleProps) === null || _props$styleProps2 === void 0 ? void 0 : _props$styleProps2.titleStyleProps)
90
+ };
91
+ const contentStyles = { ..._defaultCitationPaneContentStyles.defaultCitationPaneContentStyles,
92
+ ...((_props$styleProps3 = props.styleProps) === null || _props$styleProps3 === void 0 ? void 0 : _props$styleProps3.contentStyleProps)
93
+ };
94
+ const closeButtonStyles = {
95
+ root: Object.assign({}, _defaultCitationPaneCloseButtonStyles.defaultCitationPaneCloseButtonStyles, (_props$styleProps4 = props.styleProps) === null || _props$styleProps4 === void 0 ? void 0 : _props$styleProps4.closeButtonStyleProps),
96
+ rootHovered: Object.assign({}, _defaultCitationPaneCloseButtonHoveredStyles.defaultCitationPaneCloseButtonHoveredStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.closeButtonHoveredStyleProps),
97
+ rootFocused: Object.assign({}, _defaultCitationPaneCloseButtonFocusedStyles.defaultCitationPaneCloseButtonFocusedStyles, (_props$styleProps6 = props.styleProps) === null || _props$styleProps6 === void 0 ? void 0 : _props$styleProps6.closeButtonFocusedStyleProps),
98
+ rootPressed: Object.assign({}, _defaultCitationPaneCloseButtonHoveredStyles.defaultCitationPaneCloseButtonHoveredStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.closeButtonHoveredStyleProps)
99
+ };
100
+ const topCloseButtonPosition = ((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.topCloseButtonPosition) || _defaultCitationPaneControlProps.defaultCitationPaneControlProps.topCloseButtonPosition;
101
+ const topCloseButtonStyles = {
102
+ root: Object.assign({}, _defaultCitationPaneTopCloseButtonStyles.defaultCitationPaneTopCloseButtonStyles, (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : _props$styleProps8.topCloseButtonStyleProps, topCloseButtonPosition === "topLeft" ? {
103
+ left: "0.5em",
104
+ right: "auto"
105
+ } : {
106
+ right: "0.5em",
107
+ left: "auto"
108
+ }),
109
+ rootHovered: Object.assign({}, _defaultCitationPaneTopCloseButtonHoveredStyles.defaultCitationPaneTopCloseButtonHoveredStyles, (_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : _props$styleProps9.topCloseButtonHoveredStyleProps),
110
+ rootFocused: Object.assign({}, _defaultCitationPaneTopCloseButtonFocusedStyles.defaultCitationPaneTopCloseButtonFocusedStyles, (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.topCloseButtonFocusedStyleProps),
111
+ rootPressed: Object.assign({}, _defaultCitationPaneTopCloseButtonHoveredStyles.defaultCitationPaneTopCloseButtonHoveredStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.topCloseButtonHoveredStyleProps)
112
+ };
113
+ return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement(_react.Stack, {
114
+ id: elementId,
115
+ role: "dialog",
116
+ "aria-labelledby": elementId + "-title",
117
+ "aria-describedby": elementId + "-content",
118
+ dir: ((_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.dir) || _defaultCitationPaneControlProps.defaultCitationPaneControlProps.dir,
119
+ styles: containerStyles,
120
+ className: (_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 ? void 0 : (_props$styleProps12$c = _props$styleProps12.classNames) === null || _props$styleProps12$c === void 0 ? void 0 : _props$styleProps12$c.containerClassName,
121
+ onKeyDown: handleEscKeyDown,
122
+ tabIndex: -1
123
+ }, !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hideTopCloseButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.topCloseButton) || /*#__PURE__*/_react2.default.createElement(_react.IconButton, {
124
+ onClick: handleTopClose,
125
+ id: elementId + "-top-close",
126
+ iconProps: {
127
+ iconName: "ChromeClose"
128
+ },
129
+ ariaLabel: ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.topCloseButtonAriaLabel) || _defaultCitationPaneControlProps.defaultCitationPaneControlProps.topCloseButtonAriaLabel,
130
+ styles: topCloseButtonStyles,
131
+ className: (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : (_props$styleProps13$c = _props$styleProps13.classNames) === null || _props$styleProps13$c === void 0 ? void 0 : _props$styleProps13$c.topCloseButtonClassName
132
+ })), !((_props$controlProps8 = props.controlProps) !== null && _props$controlProps8 !== void 0 && _props$controlProps8.hideTitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.title) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
133
+ id: elementId + "-title",
134
+ styles: titleStyles,
135
+ className: (_props$styleProps14 = props.styleProps) === null || _props$styleProps14 === void 0 ? void 0 : (_props$styleProps14$c = _props$styleProps14.classNames) === null || _props$styleProps14$c === void 0 ? void 0 : _props$styleProps14$c.titleClassName
136
+ }, ((_props$controlProps9 = props.controlProps) === null || _props$controlProps9 === void 0 ? void 0 : _props$controlProps9.titleText) || _defaultCitationPaneControlProps.defaultCitationPaneControlProps.titleText)), /*#__PURE__*/_react2.default.createElement("div", {
137
+ id: elementId + "-content",
138
+ style: contentStyles,
139
+ className: (_props$styleProps15 = props.styleProps) === null || _props$styleProps15 === void 0 ? void 0 : (_props$styleProps15$c = _props$styleProps15.classNames) === null || _props$styleProps15$c === void 0 ? void 0 : _props$styleProps15$c.contentClassName,
140
+ dangerouslySetInnerHTML: {
141
+ __html: ((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.contentHtml) ?? ""
142
+ }
143
+ }), !((_props$controlProps11 = props.controlProps) !== null && _props$controlProps11 !== void 0 && _props$controlProps11.hideCloseButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.closeButton) || /*#__PURE__*/_react2.default.createElement(_react.DefaultButton, {
144
+ onClick: handleClose,
145
+ id: elementId + "-close",
146
+ text: ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.closeButtonText) || _defaultCitationPaneControlProps.defaultCitationPaneControlProps.closeButtonText,
147
+ ariaLabel: ((_props$controlProps13 = props.controlProps) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.closeButtonAriaLabel) || _defaultCitationPaneControlProps.defaultCitationPaneControlProps.closeButtonAriaLabel,
148
+ styles: closeButtonStyles,
149
+ className: (_props$styleProps16 = props.styleProps) === null || _props$styleProps16 === void 0 ? void 0 : (_props$styleProps16$c = _props$styleProps16.classNames) === null || _props$styleProps16$c === void 0 ? void 0 : _props$styleProps16$c.closeButtonClassName
150
+ }))));
151
+ }
152
+
153
+ var _default = CitationPane;
154
+ exports.default = _default;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.CitationPaneScalingTest = void 0;
7
+
8
+ var _CitationPane = _interopRequireDefault(require("./CitationPane"));
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ /**
15
+ * Test component to verify CitationPane scaling behavior at different zoom levels
16
+ * This demonstrates how the component responds to 50% to 400% view sizes
17
+ */
18
+ const CitationPaneScalingTest = () => {
19
+ const baseProps = {
20
+ controlProps: {
21
+ id: "scaling-test-citation",
22
+ titleText: "Scaling Test Citation",
23
+ contentHtml: `
24
+ <div>
25
+ <p>This citation pane is designed to scale properly from 50% to 400% zoom levels.</p>
26
+ <p><strong>Key improvements for scaling:</strong></p>
27
+ <ul>
28
+ <li>Uses <code>em</code> units instead of <code>px</code> for dimensions</li>
29
+ <li>Scalable padding, margins, and positioning</li>
30
+ <li>Relative font sizes throughout</li>
31
+ <li>Container-relative maximum height instead of viewport-based</li>
32
+ </ul>
33
+ <p><strong>Test Instructions:</strong></p>
34
+ <ol>
35
+ <li>Use your browser's zoom controls (Ctrl/Cmd + or -)</li>
36
+ <li>Test zoom levels: 50%, 75%, 100%, 150%, 200%, 300%, 400%</li>
37
+ <li>Verify all elements remain proportional and usable</li>
38
+ <li>Check that buttons remain clickable and text remains readable</li>
39
+ </ol>
40
+ </div>
41
+ `,
42
+ closeButtonText: "Close Test",
43
+ onClose: () => {
44
+ console.log("Scaling test close button clicked at current zoom level");
45
+ }
46
+ }
47
+ };
48
+ return /*#__PURE__*/_react.default.createElement("div", {
49
+ style: {
50
+ padding: "2em",
51
+ backgroundColor: "#f5f5f5",
52
+ minHeight: "100vh",
53
+ display: "flex",
54
+ alignItems: "center",
55
+ justifyContent: "center"
56
+ }
57
+ }, /*#__PURE__*/_react.default.createElement("div", {
58
+ style: {
59
+ maxWidth: "600px"
60
+ }
61
+ }, /*#__PURE__*/_react.default.createElement("h2", {
62
+ style: {
63
+ marginBottom: "1em",
64
+ textAlign: "center"
65
+ }
66
+ }, "CitationPane Scaling Test"), /*#__PURE__*/_react.default.createElement("p", {
67
+ style: {
68
+ marginBottom: "2em",
69
+ textAlign: "center",
70
+ fontSize: "0.9em"
71
+ }
72
+ }, "Test this component at browser zoom levels from 50% to 400%"), /*#__PURE__*/_react.default.createElement(_CitationPane.default, baseProps)));
73
+ };
74
+
75
+ exports.CitationPaneScalingTest = CitationPaneScalingTest;
76
+ var _default = CitationPaneScalingTest;
77
+ exports.default = _default;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultCitationPaneControlProps = void 0;
7
+ const defaultCitationPaneControlProps = {
8
+ id: "ocw-citation-pane",
9
+ dir: "ltr",
10
+ hideTitle: false,
11
+ titleText: "Citation",
12
+ hideCloseButton: false,
13
+ closeButtonText: "Close",
14
+ closeButtonAriaLabel: "Close citation",
15
+ hideTopCloseButton: false,
16
+ topCloseButtonAriaLabel: "Close",
17
+ topCloseButtonPosition: "topRight",
18
+ onClose: () => {
19
+ console.log("Citation pane close");
20
+ }
21
+ };
22
+ exports.defaultCitationPaneControlProps = defaultCitationPaneControlProps;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultCitationPaneProps = void 0;
7
+
8
+ var _defaultCitationPaneControlProps = require("./defaultCitationPaneControlProps");
9
+
10
+ var _defaultCitationPaneStyleProps = require("./defaultCitationPaneStyleProps");
11
+
12
+ const defaultCitationPaneProps = {
13
+ controlProps: _defaultCitationPaneControlProps.defaultCitationPaneControlProps,
14
+ styleProps: _defaultCitationPaneStyleProps.defaultCitationPaneStyleProps
15
+ };
16
+ exports.defaultCitationPaneProps = defaultCitationPaneProps;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultCitationPaneStyleProps = void 0;
7
+
8
+ var _defaultCitationPaneCloseButtonFocusedStyles = require("../defaultStyles/defaultCitationPaneCloseButtonFocusedStyles");
9
+
10
+ var _defaultCitationPaneCloseButtonHoveredStyles = require("../defaultStyles/defaultCitationPaneCloseButtonHoveredStyles");
11
+
12
+ var _defaultCitationPaneCloseButtonStyles = require("../defaultStyles/defaultCitationPaneCloseButtonStyles");
13
+
14
+ var _defaultCitationPaneContentStyles = require("../defaultStyles/defaultCitationPaneContentStyles");
15
+
16
+ var _defaultCitationPaneGeneralStyles = require("../defaultStyles/defaultCitationPaneGeneralStyles");
17
+
18
+ var _defaultCitationPaneTitleStyles = require("../defaultStyles/defaultCitationPaneTitleStyles");
19
+
20
+ var _defaultCitationPaneTopCloseButtonFocusedStyles = require("../defaultStyles/defaultCitationPaneTopCloseButtonFocusedStyles");
21
+
22
+ var _defaultCitationPaneTopCloseButtonHoveredStyles = require("../defaultStyles/defaultCitationPaneTopCloseButtonHoveredStyles");
23
+
24
+ var _defaultCitationPaneTopCloseButtonStyles = require("../defaultStyles/defaultCitationPaneTopCloseButtonStyles");
25
+
26
+ const defaultCitationPaneStyleProps = {
27
+ generalStyleProps: _defaultCitationPaneGeneralStyles.defaultCitationPaneGeneralStyles,
28
+ titleStyleProps: _defaultCitationPaneTitleStyles.defaultCitationPaneTitleStyles,
29
+ contentStyleProps: _defaultCitationPaneContentStyles.defaultCitationPaneContentStyles,
30
+ closeButtonStyleProps: _defaultCitationPaneCloseButtonStyles.defaultCitationPaneCloseButtonStyles,
31
+ closeButtonHoveredStyleProps: _defaultCitationPaneCloseButtonHoveredStyles.defaultCitationPaneCloseButtonHoveredStyles,
32
+ closeButtonFocusedStyleProps: _defaultCitationPaneCloseButtonFocusedStyles.defaultCitationPaneCloseButtonFocusedStyles,
33
+ topCloseButtonStyleProps: _defaultCitationPaneTopCloseButtonStyles.defaultCitationPaneTopCloseButtonStyles,
34
+ topCloseButtonHoveredStyleProps: _defaultCitationPaneTopCloseButtonHoveredStyles.defaultCitationPaneTopCloseButtonHoveredStyles,
35
+ topCloseButtonFocusedStyleProps: _defaultCitationPaneTopCloseButtonFocusedStyles.defaultCitationPaneTopCloseButtonFocusedStyles
36
+ };
37
+ exports.defaultCitationPaneStyleProps = defaultCitationPaneStyleProps;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultCitationPaneCloseButtonFocusedStyles = void 0;
7
+ const defaultCitationPaneCloseButtonFocusedStyles = {
8
+ border: "2px dotted #605e5c",
9
+ outline: "none"
10
+ };
11
+ exports.defaultCitationPaneCloseButtonFocusedStyles = defaultCitationPaneCloseButtonFocusedStyles;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultCitationPaneCloseButtonHoveredStyles = void 0;
7
+ const defaultCitationPaneCloseButtonHoveredStyles = {
8
+ backgroundColor: "#f3f2f1",
9
+ color: "#323130"
10
+ };
11
+ exports.defaultCitationPaneCloseButtonHoveredStyles = defaultCitationPaneCloseButtonHoveredStyles;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultCitationPaneCloseButtonStyles = void 0;
7
+ const defaultCitationPaneCloseButtonStyles = {
8
+ marginTop: "1em",
9
+ // Space between content and close button (scalable)
10
+ alignSelf: "center",
11
+ // Center the button horizontally
12
+ backgroundColor: "#f3f2f1",
13
+ border: "1px solid #d2d0ce",
14
+ borderRadius: "0.25em",
15
+ // Scalable border radius
16
+ color: "#323130",
17
+ cursor: "pointer",
18
+ fontSize: "1em",
19
+ // Use relative font size for better scaling
20
+ fontWeight: "500",
21
+ minHeight: "2.75em",
22
+ // A11Y compliant minimum height (44px at 16px base)
23
+ minWidth: "5.5em",
24
+ // A11Y compliant minimum width (88px at 16px base)
25
+ padding: "0.5em 1em",
26
+ // Scalable padding
27
+ // Responsive hiding at high zoom levels for better content space
28
+ "@media (min-resolution: 2.5dppx), (min-resolution: 240dpi)": {
29
+ display: "none" // Hide at 250%+ zoom to preserve content space
30
+
31
+ },
32
+ selectors: {
33
+ ":hover": {
34
+ backgroundColor: "#e1dfdd",
35
+ borderColor: "#c8c6c4"
36
+ },
37
+ ":focus": {
38
+ outline: "0.125em solid #0078d4",
39
+ // Scalable outline
40
+ outlineOffset: "0.125em" // Scalable offset
41
+
42
+ },
43
+ ":active": {
44
+ backgroundColor: "#d2d0ce",
45
+ borderColor: "#c8c6c4"
46
+ }
47
+ }
48
+ };
49
+ exports.defaultCitationPaneCloseButtonStyles = defaultCitationPaneCloseButtonStyles;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultCitationPaneContentStyles = void 0;
7
+ const defaultCitationPaneContentStyles = {
8
+ fontSize: "1em",
9
+ // Use relative units for better scaling
10
+ lineHeight: "1.5",
11
+ // Already relative, good for scaling
12
+ marginBottom: "0",
13
+ // No bottom margin since close button has top margin
14
+ flex: "1",
15
+ // Allow content to grow and push close button to bottom
16
+ overflow: "auto",
17
+ // Enable scrolling for long content
18
+ paddingRight: "0.125em" // Reduced padding to give more space for text at high zoom (scalable)
19
+
20
+ };
21
+ exports.defaultCitationPaneContentStyles = defaultCitationPaneContentStyles;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultCitationPaneGeneralStyles = void 0;
7
+ const defaultCitationPaneGeneralStyles = {
8
+ position: "relative",
9
+ // Required for absolute positioning of top close button
10
+ paddingTop: "2em",
11
+ // Reduced space for top close button (scalable)
12
+ paddingLeft: "0.75em",
13
+ // Reduced left padding (scalable)
14
+ paddingRight: "0.75em",
15
+ // Reduced right padding (scalable)
16
+ paddingBottom: "0.75em",
17
+ // Reduced bottom padding (scalable)
18
+ backgroundColor: "#ffffff",
19
+ border: "1px solid #d2d0ce",
20
+ borderRadius: "0.5em",
21
+ // Scalable border radius
22
+ boxShadow: "0px 0.125em 0.25em rgba(0, 0, 0, 0.1)",
23
+ // Scalable shadow
24
+ display: "flex",
25
+ flexDirection: "column",
26
+ minHeight: "7.5em",
27
+ // Minimum height to ensure proper layout (scalable)
28
+ maxHeight: "30em",
29
+ // Container-relative height instead of viewport-based
30
+ overflow: "hidden" // Hide overflow on container, let content area handle scrolling
31
+
32
+ };
33
+ exports.defaultCitationPaneGeneralStyles = defaultCitationPaneGeneralStyles;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultCitationPaneStyles = void 0;
7
+
8
+ var _defaultCitationPaneCloseButtonFocusedStyles = require("./defaultCitationPaneCloseButtonFocusedStyles");
9
+
10
+ var _defaultCitationPaneCloseButtonHoveredStyles = require("./defaultCitationPaneCloseButtonHoveredStyles");
11
+
12
+ var _defaultCitationPaneCloseButtonStyles = require("./defaultCitationPaneCloseButtonStyles");
13
+
14
+ var _defaultCitationPaneContentStyles = require("./defaultCitationPaneContentStyles");
15
+
16
+ var _defaultCitationPaneGeneralStyles = require("./defaultCitationPaneGeneralStyles");
17
+
18
+ var _defaultCitationPaneTitleStyles = require("./defaultCitationPaneTitleStyles");
19
+
20
+ var _defaultCitationPaneTopCloseButtonFocusedStyles = require("./defaultCitationPaneTopCloseButtonFocusedStyles");
21
+
22
+ var _defaultCitationPaneTopCloseButtonHoveredStyles = require("./defaultCitationPaneTopCloseButtonHoveredStyles");
23
+
24
+ var _defaultCitationPaneTopCloseButtonStyles = require("./defaultCitationPaneTopCloseButtonStyles");
25
+
26
+ const defaultCitationPaneStyles = {
27
+ generalStyleProps: _defaultCitationPaneGeneralStyles.defaultCitationPaneGeneralStyles,
28
+ titleStyleProps: _defaultCitationPaneTitleStyles.defaultCitationPaneTitleStyles,
29
+ contentStyleProps: _defaultCitationPaneContentStyles.defaultCitationPaneContentStyles,
30
+ closeButtonStyleProps: _defaultCitationPaneCloseButtonStyles.defaultCitationPaneCloseButtonStyles,
31
+ closeButtonHoveredStyleProps: _defaultCitationPaneCloseButtonHoveredStyles.defaultCitationPaneCloseButtonHoveredStyles,
32
+ closeButtonFocusedStyleProps: _defaultCitationPaneCloseButtonFocusedStyles.defaultCitationPaneCloseButtonFocusedStyles,
33
+ topCloseButtonStyleProps: _defaultCitationPaneTopCloseButtonStyles.defaultCitationPaneTopCloseButtonStyles,
34
+ topCloseButtonHoveredStyleProps: _defaultCitationPaneTopCloseButtonHoveredStyles.defaultCitationPaneTopCloseButtonHoveredStyles,
35
+ topCloseButtonFocusedStyleProps: _defaultCitationPaneTopCloseButtonFocusedStyles.defaultCitationPaneTopCloseButtonFocusedStyles
36
+ };
37
+ exports.defaultCitationPaneStyles = defaultCitationPaneStyles;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultCitationPaneTitleStyles = void 0;
7
+ const defaultCitationPaneTitleStyles = {};
8
+ exports.defaultCitationPaneTitleStyles = defaultCitationPaneTitleStyles;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultCitationPaneTopCloseButtonFocusedStyles = void 0;
7
+ const defaultCitationPaneTopCloseButtonFocusedStyles = {
8
+ border: "2px dotted #605e5c",
9
+ outline: "none"
10
+ };
11
+ exports.defaultCitationPaneTopCloseButtonFocusedStyles = defaultCitationPaneTopCloseButtonFocusedStyles;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultCitationPaneTopCloseButtonHoveredStyles = void 0;
7
+ const defaultCitationPaneTopCloseButtonHoveredStyles = {
8
+ backgroundColor: "#f3f2f1",
9
+ color: "#323130"
10
+ };
11
+ exports.defaultCitationPaneTopCloseButtonHoveredStyles = defaultCitationPaneTopCloseButtonHoveredStyles;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultCitationPaneTopCloseButtonStyles = void 0;
7
+ const defaultCitationPaneTopCloseButtonStyles = {
8
+ position: "absolute",
9
+ top: "0.5em",
10
+ // Scalable positioning
11
+ right: "0.5em",
12
+ // Scalable positioning
13
+ minWidth: "2em",
14
+ // Scalable minimum width
15
+ height: "2em",
16
+ // Scalable height
17
+ padding: "0",
18
+ fontSize: "1em",
19
+ // Scalable font size
20
+ fontWeight: "bold",
21
+ color: "#605e5c",
22
+ backgroundColor: "transparent",
23
+ border: "none",
24
+ borderRadius: "0.25em",
25
+ // Scalable border radius
26
+ cursor: "pointer",
27
+ zIndex: 1000,
28
+ ":hover": {
29
+ backgroundColor: "#f3f2f1",
30
+ color: "#323130"
31
+ },
32
+ ":active": {
33
+ backgroundColor: "#edebe9",
34
+ color: "#201f1e"
35
+ },
36
+ ":focus": {
37
+ outline: "0.125em solid #605e5c",
38
+ // Scalable outline
39
+ outlineOffset: "0.125em" // Scalable offset
40
+
41
+ }
42
+ };
43
+ exports.defaultCitationPaneTopCloseButtonStyles = defaultCitationPaneTopCloseButtonStyles;
package/lib/cjs/index.js CHANGED
@@ -63,6 +63,12 @@ Object.defineProperty(exports, "ChatReconnectIconBase64", {
63
63
  return _Icons.ChatReconnectIconBase64;
64
64
  }
65
65
  });
66
+ Object.defineProperty(exports, "CitationPane", {
67
+ enumerable: true,
68
+ get: function () {
69
+ return _CitationPane.default;
70
+ }
71
+ });
66
72
  Object.defineProperty(exports, "CloseChatButtonIconBase64", {
67
73
  enumerable: true,
68
74
  get: function () {
@@ -262,6 +268,8 @@ var _Footer = _interopRequireDefault(require("./components/footer/Footer"));
262
268
 
263
269
  var _ConfirmationPane = _interopRequireDefault(require("./components/confirmationpane/ConfirmationPane"));
264
270
 
271
+ var _CitationPane = _interopRequireDefault(require("./components/citationpane/CitationPane"));
272
+
265
273
  var _ChatButton = _interopRequireDefault(require("./components/chatbutton/ChatButton"));
266
274
 
267
275
  var _InputValidationPane = _interopRequireDefault(require("./components/inputvalidationpane/InputValidationPane"));
@@ -30,6 +30,7 @@ export let ElementType;
30
30
  ElementType["ReconnectChatPane"] = "ReconnectChatPane";
31
31
  ElementType["ConfirmationPaneConfirmButton"] = "ConfirmationPaneConfirmButton";
32
32
  ElementType["ConfirmationPaneCancelButton"] = "ConfirmationPaneCancelButton";
33
+ ElementType["CitationPaneCloseButton"] = "CitationPaneCloseButton";
33
34
  ElementType["PreChatSurveySubmitButton"] = "PreChatSurveySubmitButton";
34
35
  ElementType["PreChatSurveyError"] = "PreChatSurveyError";
35
36
  ElementType["IncomingCallDeclineCallButton"] = "IncomingCallDeclineCallButton";