@atlaskit/contextual-survey 3.1.2 → 4.0.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 (122) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/components/FeedbackAcknowledgement.js +2 -7
  3. package/dist/cjs/components/FeedbackScoreButtons.js +21 -45
  4. package/dist/cjs/components/SignUpPrompt.js +24 -29
  5. package/dist/cjs/components/SignUpSuccess.js +5 -10
  6. package/dist/cjs/components/SuccessContainer.js +14 -19
  7. package/dist/cjs/components/SurveyContainer.js +23 -33
  8. package/dist/cjs/components/SurveyForm.js +26 -31
  9. package/dist/cjs/components/SurveyMarshal.js +16 -23
  10. package/dist/cjs/index.js +8 -4
  11. package/dist/es2019/components/FeedbackAcknowledgement.js +2 -7
  12. package/dist/es2019/components/FeedbackScoreButtons.js +18 -44
  13. package/dist/es2019/components/SignUpPrompt.js +20 -29
  14. package/dist/es2019/components/SignUpSuccess.js +5 -10
  15. package/dist/es2019/components/SuccessContainer.js +11 -19
  16. package/dist/es2019/components/SurveyContainer.js +16 -33
  17. package/dist/es2019/components/SurveyForm.js +25 -29
  18. package/dist/es2019/components/SurveyMarshal.js +12 -22
  19. package/dist/es2019/index.js +2 -3
  20. package/dist/esm/components/FeedbackAcknowledgement.js +2 -7
  21. package/dist/esm/components/FeedbackScoreButtons.js +18 -44
  22. package/dist/esm/components/SignUpPrompt.js +20 -29
  23. package/dist/esm/components/SignUpSuccess.js +5 -10
  24. package/dist/esm/components/SuccessContainer.js +11 -19
  25. package/dist/esm/components/SurveyContainer.js +20 -33
  26. package/dist/esm/components/SurveyForm.js +25 -29
  27. package/dist/esm/components/SurveyMarshal.js +13 -22
  28. package/dist/esm/index.js +2 -3
  29. package/dist/types/components/ContextualSurvey.d.ts +1 -1
  30. package/dist/types/components/FeedbackAcknowledgement.d.ts +2 -6
  31. package/dist/types/components/FeedbackScoreButtons.d.ts +2 -2
  32. package/dist/types/components/SignUpPrompt.d.ts +6 -2
  33. package/dist/types/components/SignUpSuccess.d.ts +2 -6
  34. package/dist/types/components/SuccessContainer.d.ts +1 -6
  35. package/dist/types/components/SurveyContainer.d.ts +2 -3
  36. package/dist/types/components/SurveyForm.d.ts +2 -2
  37. package/dist/types/components/SurveyMarshal.d.ts +3 -3
  38. package/dist/types/index.d.ts +2 -3
  39. package/dist/types-ts4.5/components/ContextualSurvey.d.ts +1 -1
  40. package/dist/types-ts4.5/components/FeedbackAcknowledgement.d.ts +2 -6
  41. package/dist/types-ts4.5/components/FeedbackScoreButtons.d.ts +2 -2
  42. package/dist/types-ts4.5/components/SignUpPrompt.d.ts +6 -2
  43. package/dist/types-ts4.5/components/SignUpSuccess.d.ts +2 -6
  44. package/dist/types-ts4.5/components/SuccessContainer.d.ts +1 -6
  45. package/dist/types-ts4.5/components/SurveyContainer.d.ts +1 -2
  46. package/dist/types-ts4.5/components/SurveyForm.d.ts +2 -2
  47. package/dist/types-ts4.5/components/SurveyMarshal.d.ts +3 -3
  48. package/dist/types-ts4.5/index.d.ts +2 -3
  49. package/package.json +7 -12
  50. package/dist/cjs/compiled/ContextualSurvey.js +0 -231
  51. package/dist/cjs/compiled/FeedbackAcknowledgement.js +0 -15
  52. package/dist/cjs/compiled/FeedbackScoreButtons.js +0 -64
  53. package/dist/cjs/compiled/SignUpPrompt.js +0 -80
  54. package/dist/cjs/compiled/SignUpSuccess.js +0 -22
  55. package/dist/cjs/compiled/SuccessContainer.js +0 -32
  56. package/dist/cjs/compiled/SurveyContainer.js +0 -39
  57. package/dist/cjs/compiled/SurveyForm.js +0 -141
  58. package/dist/cjs/compiled/SurveyMarshal.js +0 -63
  59. package/dist/cjs/compiled/useEscapeToDismiss.js +0 -71
  60. package/dist/cjs/fg-components.js +0 -27
  61. package/dist/es2019/compiled/ContextualSurvey.js +0 -176
  62. package/dist/es2019/compiled/FeedbackAcknowledgement.js +0 -6
  63. package/dist/es2019/compiled/FeedbackScoreButtons.js +0 -51
  64. package/dist/es2019/compiled/SignUpPrompt.js +0 -47
  65. package/dist/es2019/compiled/SignUpSuccess.js +0 -11
  66. package/dist/es2019/compiled/SuccessContainer.js +0 -21
  67. package/dist/es2019/compiled/SurveyContainer.js +0 -26
  68. package/dist/es2019/compiled/SurveyForm.js +0 -119
  69. package/dist/es2019/compiled/SurveyMarshal.js +0 -56
  70. package/dist/es2019/compiled/useEscapeToDismiss.js +0 -65
  71. package/dist/es2019/fg-components.js +0 -13
  72. package/dist/esm/compiled/ContextualSurvey.js +0 -221
  73. package/dist/esm/compiled/FeedbackAcknowledgement.js +0 -8
  74. package/dist/esm/compiled/FeedbackScoreButtons.js +0 -54
  75. package/dist/esm/compiled/SignUpPrompt.js +0 -70
  76. package/dist/esm/compiled/SignUpSuccess.js +0 -15
  77. package/dist/esm/compiled/SuccessContainer.js +0 -22
  78. package/dist/esm/compiled/SurveyContainer.js +0 -29
  79. package/dist/esm/compiled/SurveyForm.js +0 -131
  80. package/dist/esm/compiled/SurveyMarshal.js +0 -54
  81. package/dist/esm/compiled/useEscapeToDismiss.js +0 -64
  82. package/dist/esm/fg-components.js +0 -19
  83. package/dist/types/compiled/ContextualSurvey.d.ts +0 -40
  84. package/dist/types/compiled/FeedbackAcknowledgement.d.ts +0 -3
  85. package/dist/types/compiled/FeedbackScoreButtons.d.ts +0 -11
  86. package/dist/types/compiled/SignUpPrompt.d.ts +0 -10
  87. package/dist/types/compiled/SignUpSuccess.d.ts +0 -5
  88. package/dist/types/compiled/SuccessContainer.d.ts +0 -6
  89. package/dist/types/compiled/SurveyContainer.d.ts +0 -11
  90. package/dist/types/compiled/SurveyForm.d.ts +0 -12
  91. package/dist/types/compiled/SurveyMarshal.d.ts +0 -16
  92. package/dist/types/compiled/useEscapeToDismiss.d.ts +0 -6
  93. package/dist/types/fg-components.d.ts +0 -5
  94. package/dist/types-ts4.5/compiled/ContextualSurvey.d.ts +0 -40
  95. package/dist/types-ts4.5/compiled/FeedbackAcknowledgement.d.ts +0 -3
  96. package/dist/types-ts4.5/compiled/FeedbackScoreButtons.d.ts +0 -11
  97. package/dist/types-ts4.5/compiled/SignUpPrompt.d.ts +0 -10
  98. package/dist/types-ts4.5/compiled/SignUpSuccess.d.ts +0 -5
  99. package/dist/types-ts4.5/compiled/SuccessContainer.d.ts +0 -6
  100. package/dist/types-ts4.5/compiled/SurveyContainer.d.ts +0 -11
  101. package/dist/types-ts4.5/compiled/SurveyForm.d.ts +0 -12
  102. package/dist/types-ts4.5/compiled/SurveyMarshal.d.ts +0 -16
  103. package/dist/types-ts4.5/compiled/useEscapeToDismiss.d.ts +0 -6
  104. package/dist/types-ts4.5/fg-components.d.ts +0 -5
  105. /package/dist/cjs/{compiled → components}/FeedbackScoreButtons.compiled.css +0 -0
  106. /package/dist/cjs/{compiled → components}/SignUpPrompt.compiled.css +0 -0
  107. /package/dist/cjs/{compiled → components}/SuccessContainer.compiled.css +0 -0
  108. /package/dist/cjs/{compiled → components}/SurveyContainer.compiled.css +0 -0
  109. /package/dist/cjs/{compiled → components}/SurveyForm.compiled.css +0 -0
  110. /package/dist/cjs/{compiled → components}/SurveyMarshal.compiled.css +0 -0
  111. /package/dist/es2019/{compiled → components}/FeedbackScoreButtons.compiled.css +0 -0
  112. /package/dist/es2019/{compiled → components}/SignUpPrompt.compiled.css +0 -0
  113. /package/dist/es2019/{compiled → components}/SuccessContainer.compiled.css +0 -0
  114. /package/dist/es2019/{compiled → components}/SurveyContainer.compiled.css +0 -0
  115. /package/dist/es2019/{compiled → components}/SurveyForm.compiled.css +0 -0
  116. /package/dist/es2019/{compiled → components}/SurveyMarshal.compiled.css +0 -0
  117. /package/dist/esm/{compiled → components}/FeedbackScoreButtons.compiled.css +0 -0
  118. /package/dist/esm/{compiled → components}/SignUpPrompt.compiled.css +0 -0
  119. /package/dist/esm/{compiled → components}/SuccessContainer.compiled.css +0 -0
  120. /package/dist/esm/{compiled → components}/SurveyContainer.compiled.css +0 -0
  121. /package/dist/esm/{compiled → components}/SurveyForm.compiled.css +0 -0
  122. /package/dist/esm/{compiled → components}/SurveyMarshal.compiled.css +0 -0
@@ -1,131 +0,0 @@
1
- /* SurveyForm.tsx generated by @compiled/babel-plugin v0.36.1 */
2
- import _extends from "@babel/runtime/helpers/extends";
3
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
- import "./SurveyForm.compiled.css";
5
- import * as React from 'react';
6
- import { ax, ix } from "@compiled/react/runtime";
7
- import { useCallback, useRef, useState } from 'react';
8
- import { Transition } from 'react-transition-group';
9
- import Button from '@atlaskit/button/new';
10
- import { Checkbox } from '@atlaskit/checkbox';
11
- import Form, { CheckboxField, Field, FormFooter } from '@atlaskit/form';
12
- import Heading from '@atlaskit/heading';
13
- import { Stack, Text } from '@atlaskit/primitives/compiled';
14
- import Textarea from '@atlaskit/textarea';
15
- import FeedbackScoreButtons from './FeedbackScoreButtons';
16
- var transitionBaseStyles = null;
17
- var getExpandedHeight = function getExpandedHeight(ref, state) {
18
- if (!ref.current) {
19
- return '0';
20
- }
21
- switch (state) {
22
- case 'entering':
23
- return "".concat(ref.current.scrollHeight, "px");
24
- case 'entered':
25
- // needed for TextField auto height expand
26
- return "none";
27
- default:
28
- return '0';
29
- }
30
- };
31
- var transitionDuration = 200;
32
- export default (function (_ref) {
33
- var question = _ref.question,
34
- statement = _ref.statement,
35
- textPlaceholder = _ref.textPlaceholder,
36
- textLabel = _ref.textLabel,
37
- onSubmit = _ref.onSubmit;
38
- var _useState = useState(false),
39
- _useState2 = _slicedToArray(_useState, 2),
40
- expanded = _useState2[0],
41
- setExpanded = _useState2[1];
42
- var _useState3 = useState(false),
43
- _useState4 = _slicedToArray(_useState3, 2),
44
- canContactDefault = _useState4[0],
45
- setCanContactDefault = _useState4[1];
46
- var hasAutoFilledCanContactRef = useRef(false);
47
- var expandedAreaRef = useRef(null);
48
- var onScoreSelect = useCallback(function () {
49
- setExpanded(true);
50
- }, [setExpanded]);
51
-
52
- // On the first type the user types some feedback we auto select
53
- // the option for allowing feedback. This automatic selection only
54
- // happens once. After that it is up to the user to control
55
- var onFeedbackChange = useCallback(function () {
56
- if (hasAutoFilledCanContactRef.current) {
57
- return;
58
- }
59
- hasAutoFilledCanContactRef.current = true;
60
- setCanContactDefault(true);
61
- }, []);
62
- return /*#__PURE__*/React.createElement("section", {
63
- "aria-labelledby": "contextualSurveyQuestion"
64
- }, /*#__PURE__*/React.createElement(Stack, {
65
- space: "space.150"
66
- }, /*#__PURE__*/React.createElement(Heading, {
67
- id: "contextualSurveyQuestion",
68
- size: "xsmall"
69
- }, question), statement && /*#__PURE__*/React.createElement(Text, {
70
- as: "p",
71
- id: "contextualSurveyStatement"
72
- }, statement)), /*#__PURE__*/React.createElement(Form, {
73
- onSubmit: onSubmit
74
- }, function (_ref2) {
75
- var formProps = _ref2.formProps,
76
- submitting = _ref2.submitting;
77
- return /*#__PURE__*/React.createElement("form", formProps, /*#__PURE__*/React.createElement(Field, {
78
- name: "feedbackScore",
79
- isDisabled: submitting,
80
- isRequired: true
81
- }, function (_ref3) {
82
- var fieldProps = _ref3.fieldProps;
83
- return /*#__PURE__*/React.createElement(FeedbackScoreButtons, _extends({}, fieldProps, {
84
- onChange: function onChange(score) {
85
- fieldProps.onChange(score);
86
- onScoreSelect();
87
- }
88
- }));
89
- }), /*#__PURE__*/React.createElement(Transition, {
90
- in: expanded,
91
- timeout: transitionDuration,
92
- mountOnEnter: true
93
- }, function (state) {
94
- return /*#__PURE__*/React.createElement("div", {
95
- style: {
96
- transition: "max-height ".concat(transitionDuration, "ms ease-in-out"),
97
- maxHeight: getExpandedHeight(expandedAreaRef, state)
98
- },
99
- ref: expandedAreaRef,
100
- className: ax(["_1reo15vq _18m915vq"])
101
- }, /*#__PURE__*/React.createElement(Field, {
102
- name: "writtenFeedback",
103
- defaultValue: "",
104
- isDisabled: submitting
105
- }, function (_ref4) {
106
- var fieldProps = _ref4.fieldProps;
107
- return /*#__PURE__*/React.createElement(Textarea, _extends({}, fieldProps, {
108
- "aria-label": textLabel,
109
- placeholder: textPlaceholder,
110
- onChange: function onChange(event) {
111
- fieldProps.onChange(event);
112
- onFeedbackChange();
113
- }
114
- }));
115
- }), /*#__PURE__*/React.createElement(CheckboxField, {
116
- name: "canContact",
117
- isDisabled: submitting,
118
- defaultIsChecked: canContactDefault
119
- }, function (_ref5) {
120
- var fieldProps = _ref5.fieldProps;
121
- return /*#__PURE__*/React.createElement(Checkbox, _extends({}, fieldProps, {
122
- label: "Atlassian can contact me about this feedback"
123
- }));
124
- }), /*#__PURE__*/React.createElement(FormFooter, null, /*#__PURE__*/React.createElement(Button, {
125
- type: "submit",
126
- appearance: "primary",
127
- isLoading: submitting
128
- }, "Submit")));
129
- }));
130
- }));
131
- });
@@ -1,54 +0,0 @@
1
- /* SurveyMarshal.tsx generated by @compiled/babel-plugin v0.36.1 */
2
- import "./SurveyMarshal.compiled.css";
3
- import * as React from 'react';
4
- import { ax, ix } from "@compiled/react/runtime";
5
- import { Transition } from 'react-transition-group';
6
- import { layers } from '@atlaskit/theme/constants';
7
- import { surveyInnerWidth, surveyOffset } from '../constants';
8
- var animationDuration = 300;
9
- var offscreen = {
10
- translateX: "".concat(surveyInnerWidth + surveyOffset, "px"),
11
- opacity: '0'
12
- };
13
- var getAnimationProps = function getAnimationProps(state) {
14
- switch (state) {
15
- case 'entered':
16
- {
17
- return {
18
- translateX: '0',
19
- opacity: '1'
20
- };
21
- }
22
- case 'entering':
23
- case 'unmounted':
24
- case 'exited':
25
- case 'exiting':
26
- {
27
- return offscreen;
28
- }
29
- }
30
- };
31
- var transitionBaseStyles = null;
32
- export default function SurveyMarshal(props) {
33
- var children = props.children,
34
- shouldShow = props.shouldShow;
35
- return /*#__PURE__*/React.createElement(Transition, {
36
- in: shouldShow,
37
- timeout: animationDuration,
38
- unmountOnExit: true
39
- }, function (state) {
40
- var _getAnimationProps = getAnimationProps(state),
41
- translateX = _getAnimationProps.translateX,
42
- opacity = _getAnimationProps.opacity;
43
- return /*#__PURE__*/React.createElement("div", {
44
- className: ax(["_kqsw1n9t _1xi28err _94n58err _k8m01rjc"]),
45
- style: {
46
- opacity: opacity,
47
- transition: "all ".concat(animationDuration, "ms ease-in-out"),
48
- zIndex: layers.flag(),
49
- transform: "translateX(".concat(translateX, ")"),
50
- "--_1hx5ohh": ix("".concat(surveyOffset, "px"))
51
- }
52
- }, children());
53
- });
54
- }
@@ -1,64 +0,0 @@
1
- import { useEffect, useRef } from 'react';
2
- export var escape = 27;
3
- function bind(target, eventName, handler, options) {
4
- target.addEventListener(eventName, handler, options);
5
- return function unbind() {
6
- target.removeEventListener(eventName, handler, options);
7
- };
8
- }
9
- function shouldDismiss(target) {
10
- if (!target) {
11
- return true;
12
- }
13
- if (!(target instanceof HTMLElement)) {
14
- return true;
15
- }
16
-
17
- // Closest doesn't exist for ie11
18
- // Because we cannot be sure if in a text area - just don't allow dismissing
19
- if (!target.closest) {
20
- return false;
21
- }
22
- var inTextArea = Boolean(target.closest('textarea'));
23
-
24
- // Allow dismissing if not in a textarea
25
- return !inTextArea;
26
- }
27
- export default function useEscapeToDismiss(_ref) {
28
- var onDismiss = _ref.onDismiss;
29
- var onDismissRef = useRef(onDismiss);
30
-
31
- // Defensively accounting for consumer passing in a new function
32
- // each time. We just want to call the latest one
33
- useEffect(function () {
34
- onDismissRef.current = onDismiss;
35
- }, [onDismiss]);
36
- useEffect(function () {
37
- var unbind;
38
- function onKeyDown(event) {
39
- if (event.keyCode !== escape) {
40
- return;
41
- }
42
-
43
- // Escape pressed
44
-
45
- // We don't want to close if the user is typing in the text area
46
- if (!shouldDismiss(event.target)) {
47
- return;
48
- }
49
- if (unbind) {
50
- // only want to call dismiss once
51
- unbind();
52
- }
53
- onDismissRef.current();
54
- }
55
- unbind = bind(window, 'keydown',
56
- // @ts-ignore: the typescript for this is lame
57
- onKeyDown, {
58
- passive: true
59
- });
60
-
61
- // double calls to unbind is fine
62
- return unbind;
63
- }, []);
64
- }
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
- import { default as CompiledContextualSurvey } from './compiled/ContextualSurvey';
4
- import { default as CompiledSurveyMarshal } from './compiled/SurveyMarshal';
5
- // exported props for FG check
6
- import { default as EmotionContextualSurvey } from './components/ContextualSurvey';
7
- import { default as EmotionSurveyMarshal } from './components/SurveyMarshal';
8
- export var ContextualSurvey = function ContextualSurvey(props) {
9
- return (
10
- // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
11
- fg('platform_contextual_survey_enable_compiled_fg') ? /*#__PURE__*/React.createElement(CompiledContextualSurvey, props) : /*#__PURE__*/React.createElement(EmotionContextualSurvey, props)
12
- );
13
- };
14
- export var SurveyMarshal = function SurveyMarshal(props) {
15
- return (
16
- // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
17
- fg('platform_contextual_survey_enable_compiled_fg') ? /*#__PURE__*/React.createElement(CompiledSurveyMarshal, props) : /*#__PURE__*/React.createElement(EmotionSurveyMarshal, props)
18
- );
19
- };
@@ -1,40 +0,0 @@
1
- import React from 'react';
2
- import { type FormValues } from '../types';
3
- export declare enum DismissTrigger {
4
- AutoDismiss = "AUTO_DISMISS",
5
- Manual = "MANUAL",
6
- Finished = "FINISHED",
7
- Unmount = "UNMOUNT"
8
- }
9
- export type OnDismissArgs = {
10
- trigger: DismissTrigger;
11
- };
12
- interface Props {
13
- /** Optional statement, to be used in conjunction with the question for the survey
14
- * Example: "How strongly do you agree or disagree with this statement"
15
- */
16
- statement?: string;
17
- /** Question used for the survey
18
- * Example: "It is easy to find what I am looking for in Jira"
19
- */
20
- question: string;
21
- /** Accessible label text for the survey text area */
22
- textLabel?: string;
23
- /** Text placeholder for the survey text area
24
- * Example: "Tell us why"
25
- */
26
- textPlaceholder?: string;
27
- /** Callback that is triggered when the survey should be dismissed */
28
- onDismiss: (args: OnDismissArgs) => void;
29
- /** Gets whether user has already signed up to the Atlassian Research Group list.
30
- * If `true` is returned then the user will not be prompted to sign up to the Research Group.
31
- */
32
- getUserHasAnsweredMailingList: () => Promise<boolean>;
33
- /** Callback that is triggered when the survey is submitted, it will get the survey data as a parameter */
34
- onSubmit: (formValues: FormValues) => Promise<void>;
35
- /** Callback that is triggered when the user clicks 'Yes' or 'No' to sign up to the Atlassian Research Group */
36
- onMailingListAnswer: (answer: boolean) => Promise<void>;
37
- }
38
- export declare const AUTO_DISAPPEAR_DURATION: number;
39
- declare const _default: ({ question, statement, onDismiss, onSubmit, onMailingListAnswer, getUserHasAnsweredMailingList, textLabel, textPlaceholder, }: Props) => React.JSX.Element;
40
- export default _default;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const _default: () => React.JSX.Element;
3
- export default _default;
@@ -1,11 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- /// <reference types="react" />
6
- interface Props {
7
- onChange: (value: number) => void;
8
- value: number | undefined;
9
- }
10
- declare const _default: ({ onChange, value }: Props) => JSX.Element;
11
- export default _default;
@@ -1,10 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- /// <reference types="react" />
6
- interface Props {
7
- onAnswer: (answer: boolean) => Promise<void>;
8
- }
9
- declare const _default: ({ onAnswer }: Props) => JSX.Element;
10
- export default _default;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- interface Props {
3
- }
4
- declare const _default: ({}: Props) => React.JSX.Element;
5
- export default _default;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- interface Props {
3
- children: React.ReactNode;
4
- }
5
- declare const _default: ({ children }: Props) => JSX.Element;
6
- export default _default;
@@ -1,11 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- /// <reference types="react" />
6
- interface Props {
7
- children: React.ReactNode;
8
- onDismiss: () => void;
9
- }
10
- declare const _default: ({ children, onDismiss }: Props) => JSX.Element;
11
- export default _default;
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { type OnSubmitHandler } from '@atlaskit/form';
3
- import { type FormValues } from '../types';
4
- interface Props {
5
- question: string;
6
- statement?: string;
7
- textPlaceholder: string;
8
- textLabel: string;
9
- onSubmit: OnSubmitHandler<FormValues>;
10
- }
11
- declare const _default: ({ question, statement, textPlaceholder, textLabel, onSubmit }: Props) => JSX.Element;
12
- export default _default;
@@ -1,16 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type ReactNode } from 'react';
6
- type Props = {
7
- /** Whether the form should be rendered */
8
- shouldShow: boolean;
9
- /** A function that returns Node to be rendered (`<ContextualSurvey/>`)
10
- * Using a function as child so that the child node does
11
- * not need to be evaluated if it is not mounted
12
- */
13
- children: () => ReactNode;
14
- };
15
- export default function SurveyMarshal(props: Props): JSX.Element;
16
- export {};
@@ -1,6 +0,0 @@
1
- export declare const escape: number;
2
- type Args = {
3
- onDismiss: () => void;
4
- };
5
- export default function useEscapeToDismiss({ onDismiss }: Args): void;
6
- export {};
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { type Props as ContextualSurveyProps } from './components/ContextualSurvey';
3
- import { type Props as SurveyMarshalProps } from './components/SurveyMarshal';
4
- export declare const ContextualSurvey: (props: ContextualSurveyProps) => React.JSX.Element;
5
- export declare const SurveyMarshal: (props: SurveyMarshalProps) => React.JSX.Element;
@@ -1,40 +0,0 @@
1
- import React from 'react';
2
- import { type FormValues } from '../types';
3
- export declare enum DismissTrigger {
4
- AutoDismiss = "AUTO_DISMISS",
5
- Manual = "MANUAL",
6
- Finished = "FINISHED",
7
- Unmount = "UNMOUNT"
8
- }
9
- export type OnDismissArgs = {
10
- trigger: DismissTrigger;
11
- };
12
- interface Props {
13
- /** Optional statement, to be used in conjunction with the question for the survey
14
- * Example: "How strongly do you agree or disagree with this statement"
15
- */
16
- statement?: string;
17
- /** Question used for the survey
18
- * Example: "It is easy to find what I am looking for in Jira"
19
- */
20
- question: string;
21
- /** Accessible label text for the survey text area */
22
- textLabel?: string;
23
- /** Text placeholder for the survey text area
24
- * Example: "Tell us why"
25
- */
26
- textPlaceholder?: string;
27
- /** Callback that is triggered when the survey should be dismissed */
28
- onDismiss: (args: OnDismissArgs) => void;
29
- /** Gets whether user has already signed up to the Atlassian Research Group list.
30
- * If `true` is returned then the user will not be prompted to sign up to the Research Group.
31
- */
32
- getUserHasAnsweredMailingList: () => Promise<boolean>;
33
- /** Callback that is triggered when the survey is submitted, it will get the survey data as a parameter */
34
- onSubmit: (formValues: FormValues) => Promise<void>;
35
- /** Callback that is triggered when the user clicks 'Yes' or 'No' to sign up to the Atlassian Research Group */
36
- onMailingListAnswer: (answer: boolean) => Promise<void>;
37
- }
38
- export declare const AUTO_DISAPPEAR_DURATION: number;
39
- declare const _default: ({ question, statement, onDismiss, onSubmit, onMailingListAnswer, getUserHasAnsweredMailingList, textLabel, textPlaceholder, }: Props) => React.JSX.Element;
40
- export default _default;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const _default: () => React.JSX.Element;
3
- export default _default;
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- /**
3
- * @jsxRuntime classic
4
- * @jsx jsx
5
- */
6
- interface Props {
7
- onChange: (value: number) => void;
8
- value: number | undefined;
9
- }
10
- declare const _default: ({ onChange, value }: Props) => JSX.Element;
11
- export default _default;
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- /**
3
- * @jsxRuntime classic
4
- * @jsx jsx
5
- */
6
- interface Props {
7
- onAnswer: (answer: boolean) => Promise<void>;
8
- }
9
- declare const _default: ({ onAnswer }: Props) => JSX.Element;
10
- export default _default;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- interface Props {
3
- }
4
- declare const _default: ({}: Props) => React.JSX.Element;
5
- export default _default;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- interface Props {
3
- children: React.ReactNode;
4
- }
5
- declare const _default: ({ children }: Props) => JSX.Element;
6
- export default _default;
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- /**
3
- * @jsxRuntime classic
4
- * @jsx jsx
5
- */
6
- interface Props {
7
- children: React.ReactNode;
8
- onDismiss: () => void;
9
- }
10
- declare const _default: ({ children, onDismiss }: Props) => JSX.Element;
11
- export default _default;
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { type OnSubmitHandler } from '@atlaskit/form';
3
- import { type FormValues } from '../types';
4
- interface Props {
5
- question: string;
6
- statement?: string;
7
- textPlaceholder: string;
8
- textLabel: string;
9
- onSubmit: OnSubmitHandler<FormValues>;
10
- }
11
- declare const _default: ({ question, statement, textPlaceholder, textLabel, onSubmit }: Props) => JSX.Element;
12
- export default _default;
@@ -1,16 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type ReactNode } from 'react';
6
- type Props = {
7
- /** Whether the form should be rendered */
8
- shouldShow: boolean;
9
- /** A function that returns Node to be rendered (`<ContextualSurvey/>`)
10
- * Using a function as child so that the child node does
11
- * not need to be evaluated if it is not mounted
12
- */
13
- children: () => ReactNode;
14
- };
15
- export default function SurveyMarshal(props: Props): JSX.Element;
16
- export {};
@@ -1,6 +0,0 @@
1
- export declare const escape: number;
2
- type Args = {
3
- onDismiss: () => void;
4
- };
5
- export default function useEscapeToDismiss({ onDismiss }: Args): void;
6
- export {};
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { type Props as ContextualSurveyProps } from './components/ContextualSurvey';
3
- import { type Props as SurveyMarshalProps } from './components/SurveyMarshal';
4
- export declare const ContextualSurvey: (props: ContextualSurveyProps) => React.JSX.Element;
5
- export declare const SurveyMarshal: (props: SurveyMarshalProps) => React.JSX.Element;