@atlaskit/contextual-survey 2.2.1 → 2.2.2

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.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
8
+
3
9
  ## 2.2.1
4
10
 
5
11
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/contextual-survey",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/contextual-survey",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/contextual-survey",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,40 @@
1
+ /// <reference types="react" />
2
+ import { 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) => JSX.Element;
40
+ export default _default;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: () => JSX.Element;
3
+ export default _default;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface Props {
3
+ onChange: (value: number) => void;
4
+ value: number | undefined;
5
+ }
6
+ declare const _default: ({ onChange, value }: Props) => JSX.Element;
7
+ export default _default;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ interface Props {
3
+ onAnswer: (answer: boolean) => Promise<void>;
4
+ }
5
+ declare const _default: ({ onAnswer }: Props) => JSX.Element;
6
+ export default _default;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ interface Props {
3
+ }
4
+ declare const _default: ({}: Props) => JSX.Element;
5
+ export default _default;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ interface Props {
3
+ children: React.ReactNode;
4
+ }
5
+ declare const _default: ({ children }: Props) => JSX.Element;
6
+ export default _default;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface Props {
3
+ children: React.ReactNode;
4
+ onDismiss: () => void;
5
+ }
6
+ declare const _default: ({ children, onDismiss }: Props) => JSX.Element;
7
+ export default _default;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { OnSubmitHandler } from '@atlaskit/form';
3
+ import { 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;
@@ -0,0 +1,13 @@
1
+ /** @jsx jsx */
2
+ import { ReactNode } from 'react';
3
+ type Props = {
4
+ /** Whether the form should be rendered */
5
+ shouldShow: boolean;
6
+ /** A function that returns Node to be rendered (`<ContextualSurvey/>`)
7
+ * Using a function as child so that the child node does
8
+ * not need to be evaluated if it is not mounted
9
+ */
10
+ children: () => ReactNode;
11
+ };
12
+ export default function SurveyMarshal(props: Props): JSX.Element;
13
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare const escape: number;
2
+ type Args = {
3
+ onDismiss: () => void;
4
+ };
5
+ export default function useEscapeToDismiss({ onDismiss }: Args): void;
6
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const surveyInnerWidth: number;
2
+ export declare const surveyOffset: number;
@@ -0,0 +1,3 @@
1
+ export { default as ContextualSurvey, DismissTrigger, } from './components/ContextualSurvey';
2
+ export type { OnDismissArgs } from './components/ContextualSurvey';
3
+ export { default as SurveyMarshal } from './components/SurveyMarshal';
@@ -0,0 +1,5 @@
1
+ export type FormValues = {
2
+ feedbackScore: number;
3
+ canContact: boolean;
4
+ writtenFeedback: string;
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/contextual-survey",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "A React component used to ask the user for feedback",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"