@atlaskit/contextual-survey 2.2.14 → 2.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/contextual-survey
2
2
 
3
+ ## 2.2.15
4
+
5
+ ### Patch Changes
6
+
7
+ - [#84829](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84829) [`a6299ec57bc3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a6299ec57bc3) - Internal change to replace hardcoded font fallback values with an exported constant. There is no expected visual difference.
8
+
3
9
  ## 2.2.14
4
10
 
5
11
  ### Patch Changes
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = require("@emotion/react");
9
+ var _typography = require("@atlaskit/theme/typography");
9
10
  var _SuccessContainer = _interopRequireDefault(require("./SuccessContainer"));
10
11
  /** @jsx jsx */
11
12
 
12
13
  var styles = (0, _react.css)({
13
- font: "var(--ds-font-heading-xsmall, normal 600 14px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
14
+ font: "var(--ds-font-heading-xsmall, ".concat(_typography.fontFallback.heading.xsmall, ")"),
14
15
  marginTop: 0
15
16
  });
16
17
  var _default = exports.default = function _default() {
@@ -11,11 +11,12 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
11
11
  var _react = require("react");
12
12
  var _react2 = require("@emotion/react");
13
13
  var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
14
+ var _typography = require("@atlaskit/theme/typography");
14
15
  var _SuccessContainer = _interopRequireDefault(require("./SuccessContainer"));
15
16
  /** @jsx jsx */
16
17
 
17
18
  var styles = (0, _react2.css)({
18
- font: "var(--ds-font-heading-xsmall, normal 600 14px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
19
+ font: "var(--ds-font-heading-xsmall, ".concat(_typography.fontFallback.heading.xsmall, ")"),
19
20
  margin: 0
20
21
  });
21
22
  var _default = exports.default = function _default(_ref) {
@@ -7,11 +7,12 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));
9
9
  var _react = require("@emotion/react");
10
+ var _typography = require("@atlaskit/theme/typography");
10
11
  var _SuccessContainer = _interopRequireDefault(require("./SuccessContainer"));
11
12
  /** @jsx jsx */
12
13
 
13
14
  var styles = (0, _react.css)({
14
- font: "var(--ds-font-heading-xsmall, normal 600 14px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
15
+ font: "var(--ds-font-heading-xsmall, ".concat(_typography.fontFallback.heading.xsmall, ")"),
15
16
  margin: 0
16
17
  });
17
18
  var _default = exports.default = function _default(_ref) {
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
11
  var _react = require("react");
13
12
  var _react2 = require("@emotion/react");
@@ -18,10 +17,14 @@ var _form = _interopRequireWildcard(require("@atlaskit/form"));
18
17
  var _textarea = _interopRequireDefault(require("@atlaskit/textarea"));
19
18
  var _constants = require("@atlaskit/theme/constants");
20
19
  var _FeedbackScoreButtons = _interopRequireDefault(require("./FeedbackScoreButtons"));
21
- var _templateObject, _templateObject2;
22
- /** @jsx jsx */
23
20
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
24
21
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
+ /** @jsx jsx */
23
+
24
+ var headingStyles = (0, _react2.css)({
25
+ fontSize: "".concat((0, _constants.fontSize)(), "px"),
26
+ fontWeight: 600
27
+ });
25
28
  var getExpandedHeight = function getExpandedHeight(ref, state) {
26
29
  if (!ref.current) {
27
30
  return '0';
@@ -71,7 +74,7 @@ var _default = exports.default = function _default(_ref) {
71
74
  "aria-labelledby": "contextualSurveyQuestion"
72
75
  }, (0, _react2.jsx)("h1", {
73
76
  id: "contextualSurveyQuestion",
74
- css: (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", "px;\n font-weight: 600;\n "])), (0, _constants.fontSize)())
77
+ css: headingStyles
75
78
  }, question), statement && (0, _react2.jsx)("p", {
76
79
  id: "contextualSurveyStatement"
77
80
  }, statement), (0, _react2.jsx)(_form.default, {
@@ -97,7 +100,11 @@ var _default = exports.default = function _default(_ref) {
97
100
  mountOnEnter: true
98
101
  }, function (state) {
99
102
  return (0, _react2.jsx)("div", {
100
- css: (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n transition: max-height ", "ms ease-in-out;\n overflow: hidden;\n max-height: ", ";\n "])), transitionDuration, getExpandedHeight(expandedAreaRef, state)),
103
+ css: (0, _react2.css)({
104
+ transition: "max-height ".concat(transitionDuration, "ms ease-in-out"),
105
+ overflow: 'hidden',
106
+ maxHeight: getExpandedHeight(expandedAreaRef, state)
107
+ }),
101
108
  ref: expandedAreaRef
102
109
  }, (0, _react2.jsx)(_form.Field, {
103
110
  name: "writtenFeedback",
@@ -1,17 +1,15 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = SurveyMarshal;
8
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
7
  var _react = require("@emotion/react");
10
8
  var _reactTransitionGroup = require("react-transition-group");
11
9
  var _constants = require("@atlaskit/theme/constants");
12
10
  var _constants2 = require("../constants");
13
- var _templateObject;
14
11
  /** @jsx jsx */
12
+
15
13
  var animationDuration = 300;
16
14
  var offscreen = {
17
15
  translateX: "".concat(_constants2.surveyInnerWidth + _constants2.surveyOffset, "px"),
@@ -19,10 +17,6 @@ var offscreen = {
19
17
  };
20
18
  var getAnimationProps = function getAnimationProps(state) {
21
19
  switch (state) {
22
- case 'entering':
23
- {
24
- return offscreen;
25
- }
26
20
  case 'entered':
27
21
  {
28
22
  return {
@@ -30,6 +24,8 @@ var getAnimationProps = function getAnimationProps(state) {
30
24
  opacity: '1'
31
25
  };
32
26
  }
27
+ case 'entering':
28
+ case 'unmounted':
33
29
  case 'exited':
34
30
  case 'exiting':
35
31
  {
@@ -49,7 +45,16 @@ function SurveyMarshal(props) {
49
45
  translateX = _getAnimationProps.translateX,
50
46
  opacity = _getAnimationProps.opacity;
51
47
  return (0, _react.jsx)("div", {
52
- css: (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: fixed;\n right: ", "px;\n bottom: ", "px;\n z-index: ", ";\n transform: translateX(", ");\n opacity: ", ";\n transition: all ", "ms ease-in-out;\n transition-property: transform, opacity;\n "])), _constants2.surveyOffset, _constants2.surveyOffset, _constants.layers.flag(), translateX, opacity, animationDuration)
48
+ css: (0, _react.css)({
49
+ position: 'fixed',
50
+ right: "".concat(_constants2.surveyOffset, "px"),
51
+ bottom: "".concat(_constants2.surveyOffset, "px"),
52
+ zIndex: _constants.layers.flag(),
53
+ transform: "translateX(".concat(translateX, ")"),
54
+ opacity: opacity,
55
+ transition: "all ".concat(animationDuration, "ms ease-in-out"),
56
+ transitionProperty: 'transform, opacity'
57
+ })
53
58
  }, children());
54
59
  });
55
60
  }
@@ -1,8 +1,9 @@
1
1
  /** @jsx jsx */
2
2
  import { css, jsx } from '@emotion/react';
3
+ import { fontFallback } from '@atlaskit/theme/typography';
3
4
  import SuccessContainer from './SuccessContainer';
4
5
  const styles = css({
5
- font: "var(--ds-font-heading-xsmall, normal 600 14px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
6
+ font: `var(--ds-font-heading-xsmall, ${fontFallback.heading.xsmall})`,
6
7
  marginTop: 0
7
8
  });
8
9
  export default (() => jsx(SuccessContainer, null, jsx("h1", {
@@ -2,9 +2,10 @@
2
2
  import { useCallback, useState } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import Button from '@atlaskit/button/custom-theme-button';
5
+ import { fontFallback } from '@atlaskit/theme/typography';
5
6
  import SuccessContainer from './SuccessContainer';
6
7
  const styles = css({
7
- font: "var(--ds-font-heading-xsmall, normal 600 14px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
8
+ font: `var(--ds-font-heading-xsmall, ${fontFallback.heading.xsmall})`,
8
9
  margin: 0
9
10
  });
10
11
  export default (({
@@ -1,8 +1,9 @@
1
1
  /** @jsx jsx */
2
2
  import { css, jsx } from '@emotion/react';
3
+ import { fontFallback } from '@atlaskit/theme/typography';
3
4
  import SuccessContainer from './SuccessContainer';
4
5
  const styles = css({
5
- font: "var(--ds-font-heading-xsmall, normal 600 14px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
6
+ font: `var(--ds-font-heading-xsmall, ${fontFallback.heading.xsmall})`,
6
7
  margin: 0
7
8
  });
8
9
  export default (({}) => jsx(SuccessContainer, null, jsx("h1", {
@@ -9,6 +9,10 @@ import Form, { CheckboxField, Field, FormFooter } from '@atlaskit/form';
9
9
  import Textarea from '@atlaskit/textarea';
10
10
  import { fontSize } from '@atlaskit/theme/constants';
11
11
  import FeedbackScoreButtons from './FeedbackScoreButtons';
12
+ const headingStyles = css({
13
+ fontSize: `${fontSize()}px`,
14
+ fontWeight: 600
15
+ });
12
16
  const getExpandedHeight = (ref, state) => {
13
17
  if (!ref.current) {
14
18
  return '0';
@@ -53,10 +57,7 @@ export default (({
53
57
  "aria-labelledby": "contextualSurveyQuestion"
54
58
  }, jsx("h1", {
55
59
  id: "contextualSurveyQuestion",
56
- css: css`
57
- font-size: ${fontSize()}px;
58
- font-weight: 600;
59
- `
60
+ css: headingStyles
60
61
  }, question), statement && jsx("p", {
61
62
  id: "contextualSurveyStatement"
62
63
  }, statement), jsx(Form, {
@@ -80,11 +81,11 @@ export default (({
80
81
  timeout: transitionDuration,
81
82
  mountOnEnter: true
82
83
  }, state => jsx("div", {
83
- css: css`
84
- transition: max-height ${transitionDuration}ms ease-in-out;
85
- overflow: hidden;
86
- max-height: ${getExpandedHeight(expandedAreaRef, state)};
87
- `,
84
+ css: css({
85
+ transition: `max-height ${transitionDuration}ms ease-in-out`,
86
+ overflow: 'hidden',
87
+ maxHeight: getExpandedHeight(expandedAreaRef, state)
88
+ }),
88
89
  ref: expandedAreaRef
89
90
  }, jsx(Field, {
90
91
  name: "writtenFeedback",
@@ -11,10 +11,6 @@ const offscreen = {
11
11
  };
12
12
  const getAnimationProps = state => {
13
13
  switch (state) {
14
- case 'entering':
15
- {
16
- return offscreen;
17
- }
18
14
  case 'entered':
19
15
  {
20
16
  return {
@@ -22,6 +18,8 @@ const getAnimationProps = state => {
22
18
  opacity: '1'
23
19
  };
24
20
  }
21
+ case 'entering':
22
+ case 'unmounted':
25
23
  case 'exited':
26
24
  case 'exiting':
27
25
  {
@@ -44,16 +42,16 @@ export default function SurveyMarshal(props) {
44
42
  opacity
45
43
  } = getAnimationProps(state);
46
44
  return jsx("div", {
47
- css: css`
48
- position: fixed;
49
- right: ${surveyOffset}px;
50
- bottom: ${surveyOffset}px;
51
- z-index: ${layers.flag()};
52
- transform: translateX(${translateX});
53
- opacity: ${opacity};
54
- transition: all ${animationDuration}ms ease-in-out;
55
- transition-property: transform, opacity;
56
- `
45
+ css: css({
46
+ position: 'fixed',
47
+ right: `${surveyOffset}px`,
48
+ bottom: `${surveyOffset}px`,
49
+ zIndex: layers.flag(),
50
+ transform: `translateX(${translateX})`,
51
+ opacity: opacity,
52
+ transition: `all ${animationDuration}ms ease-in-out`,
53
+ transitionProperty: 'transform, opacity'
54
+ })
57
55
  }, children());
58
56
  });
59
57
  }
@@ -1,8 +1,9 @@
1
1
  /** @jsx jsx */
2
2
  import { css, jsx } from '@emotion/react';
3
+ import { fontFallback } from '@atlaskit/theme/typography';
3
4
  import SuccessContainer from './SuccessContainer';
4
5
  var styles = css({
5
- font: "var(--ds-font-heading-xsmall, normal 600 14px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
6
+ font: "var(--ds-font-heading-xsmall, ".concat(fontFallback.heading.xsmall, ")"),
6
7
  marginTop: 0
7
8
  });
8
9
  export default (function () {
@@ -5,9 +5,10 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
5
5
  import { useCallback, useState } from 'react';
6
6
  import { css, jsx } from '@emotion/react';
7
7
  import Button from '@atlaskit/button/custom-theme-button';
8
+ import { fontFallback } from '@atlaskit/theme/typography';
8
9
  import SuccessContainer from './SuccessContainer';
9
10
  var styles = css({
10
- font: "var(--ds-font-heading-xsmall, normal 600 14px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
11
+ font: "var(--ds-font-heading-xsmall, ".concat(fontFallback.heading.xsmall, ")"),
11
12
  margin: 0
12
13
  });
13
14
  export default (function (_ref) {
@@ -1,9 +1,10 @@
1
1
  import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
2
2
  /** @jsx jsx */
3
3
  import { css, jsx } from '@emotion/react';
4
+ import { fontFallback } from '@atlaskit/theme/typography';
4
5
  import SuccessContainer from './SuccessContainer';
5
6
  var styles = css({
6
- font: "var(--ds-font-heading-xsmall, normal 600 14px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
7
+ font: "var(--ds-font-heading-xsmall, ".concat(fontFallback.heading.xsmall, ")"),
7
8
  margin: 0
8
9
  });
9
10
  export default (function (_ref) {
@@ -1,7 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
- var _templateObject, _templateObject2;
5
3
  /** @jsx jsx */
6
4
  import { useCallback, useRef, useState } from 'react';
7
5
  import { css, jsx } from '@emotion/react';
@@ -12,6 +10,10 @@ import Form, { CheckboxField, Field, FormFooter } from '@atlaskit/form';
12
10
  import Textarea from '@atlaskit/textarea';
13
11
  import { fontSize } from '@atlaskit/theme/constants';
14
12
  import FeedbackScoreButtons from './FeedbackScoreButtons';
13
+ var headingStyles = css({
14
+ fontSize: "".concat(fontSize(), "px"),
15
+ fontWeight: 600
16
+ });
15
17
  var getExpandedHeight = function getExpandedHeight(ref, state) {
16
18
  if (!ref.current) {
17
19
  return '0';
@@ -61,7 +63,7 @@ export default (function (_ref) {
61
63
  "aria-labelledby": "contextualSurveyQuestion"
62
64
  }, jsx("h1", {
63
65
  id: "contextualSurveyQuestion",
64
- css: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-size: ", "px;\n font-weight: 600;\n "])), fontSize())
66
+ css: headingStyles
65
67
  }, question), statement && jsx("p", {
66
68
  id: "contextualSurveyStatement"
67
69
  }, statement), jsx(Form, {
@@ -87,7 +89,11 @@ export default (function (_ref) {
87
89
  mountOnEnter: true
88
90
  }, function (state) {
89
91
  return jsx("div", {
90
- css: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n transition: max-height ", "ms ease-in-out;\n overflow: hidden;\n max-height: ", ";\n "])), transitionDuration, getExpandedHeight(expandedAreaRef, state)),
92
+ css: css({
93
+ transition: "max-height ".concat(transitionDuration, "ms ease-in-out"),
94
+ overflow: 'hidden',
95
+ maxHeight: getExpandedHeight(expandedAreaRef, state)
96
+ }),
91
97
  ref: expandedAreaRef
92
98
  }, jsx(Field, {
93
99
  name: "writtenFeedback",
@@ -1,5 +1,3 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject;
3
1
  /** @jsx jsx */
4
2
 
5
3
  import { css, jsx } from '@emotion/react';
@@ -13,10 +11,6 @@ var offscreen = {
13
11
  };
14
12
  var getAnimationProps = function getAnimationProps(state) {
15
13
  switch (state) {
16
- case 'entering':
17
- {
18
- return offscreen;
19
- }
20
14
  case 'entered':
21
15
  {
22
16
  return {
@@ -24,6 +18,8 @@ var getAnimationProps = function getAnimationProps(state) {
24
18
  opacity: '1'
25
19
  };
26
20
  }
21
+ case 'entering':
22
+ case 'unmounted':
27
23
  case 'exited':
28
24
  case 'exiting':
29
25
  {
@@ -43,7 +39,16 @@ export default function SurveyMarshal(props) {
43
39
  translateX = _getAnimationProps.translateX,
44
40
  opacity = _getAnimationProps.opacity;
45
41
  return jsx("div", {
46
- css: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: fixed;\n right: ", "px;\n bottom: ", "px;\n z-index: ", ";\n transform: translateX(", ");\n opacity: ", ";\n transition: all ", "ms ease-in-out;\n transition-property: transform, opacity;\n "])), surveyOffset, surveyOffset, layers.flag(), translateX, opacity, animationDuration)
42
+ css: css({
43
+ position: 'fixed',
44
+ right: "".concat(surveyOffset, "px"),
45
+ bottom: "".concat(surveyOffset, "px"),
46
+ zIndex: layers.flag(),
47
+ transform: "translateX(".concat(translateX, ")"),
48
+ opacity: opacity,
49
+ transition: "all ".concat(animationDuration, "ms ease-in-out"),
50
+ transitionProperty: 'transform, opacity'
51
+ })
47
52
  }, children());
48
53
  });
49
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/contextual-survey",
3
- "version": "2.2.14",
3
+ "version": "2.2.15",
4
4
  "description": "A React component used to ask the user for feedback",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -35,12 +35,12 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@atlaskit/button": "^17.7.0",
38
+ "@atlaskit/button": "^17.8.0",
39
39
  "@atlaskit/checkbox": "^13.1.0",
40
40
  "@atlaskit/form": "^9.1.0",
41
41
  "@atlaskit/icon": "^22.1.0",
42
42
  "@atlaskit/textarea": "^5.2.0",
43
- "@atlaskit/theme": "^12.6.0",
43
+ "@atlaskit/theme": "^12.7.0",
44
44
  "@atlaskit/tokens": "^1.42.0",
45
45
  "@atlaskit/tooltip": "^18.1.0",
46
46
  "@babel/runtime": "^7.0.0",