@atlaskit/contextual-survey 2.1.3 → 2.1.5

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,17 @@
1
1
  # @atlaskit/contextual-survey
2
2
 
3
+ ## 2.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
8
+
9
+ ## 2.1.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
14
+
3
15
  ## 2.1.3
4
16
 
5
17
  ### Patch Changes
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/constants.js",
5
5
  "module:es2019": "../dist/es2019/constants.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/constants.d.ts"
7
+ "types": "../dist/types/constants.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/constants.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/contextual-survey",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/contextual-survey",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,6 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import React, { useCallback, useEffect, useRef, useState } from 'react';
5
5
  import FeedbackAcknowledgement from './FeedbackAcknowledgement';
6
6
  import SignUpPrompt from './SignUpPrompt';
@@ -1,10 +1,11 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
4
 
6
5
  var _templateObject, _templateObject2;
7
6
 
7
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
8
+
8
9
  /** @jsx jsx */
9
10
  import { useCallback, useState } from 'react';
10
11
  import { css, jsx } from '@emotion/core';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/contextual-survey",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
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 declare 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
+ declare 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
+ declare 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 declare 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.1.3",
3
+ "version": "2.1.5",
4
4
  "description": "A React component used to ask the user for feedback",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,6 +12,13 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
+ "typesVersions": {
16
+ ">=4.0 <4.5": {
17
+ "*": [
18
+ "dist/types-ts4.0/*"
19
+ ]
20
+ }
21
+ },
15
22
  "sideEffects": false,
16
23
  "atlaskit:src": "src/index.ts",
17
24
  "atlassian": {
@@ -28,7 +35,7 @@
28
35
  "@atlaskit/form": "^8.5.0",
29
36
  "@atlaskit/icon": "^21.10.0",
30
37
  "@atlaskit/textarea": "^4.3.0",
31
- "@atlaskit/theme": "^12.1.0",
38
+ "@atlaskit/theme": "^12.2.0",
32
39
  "@atlaskit/tokens": "^0.10.0",
33
40
  "@atlaskit/tooltip": "^17.5.0",
34
41
  "@babel/runtime": "^7.0.0",
@@ -42,8 +49,8 @@
42
49
  "@atlaskit/checkbox": "^12.1.0",
43
50
  "@atlaskit/docs": "*",
44
51
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
45
- "@testing-library/react": "^8.0.1",
46
- "typescript": "4.2.4"
52
+ "@testing-library/react": "^12.1.5",
53
+ "typescript": "4.5.5"
47
54
  },
48
55
  "keywords": [
49
56
  "atlaskit",
package/report.api.md ADDED
@@ -0,0 +1,74 @@
1
+ ## API Report File for "@atlaskit/contextual-survey"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ <!--
6
+ Generated API Report version: 2.0
7
+ -->
8
+
9
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
10
+
11
+ ```ts
12
+ /// <reference types="react" />
13
+
14
+ import { ReactNode } from 'react';
15
+
16
+ // @public (undocumented)
17
+ export const ContextualSurvey: ({
18
+ question,
19
+ statement,
20
+ onDismiss,
21
+ onSubmit,
22
+ onMailingListAnswer,
23
+ getUserHasAnsweredMailingList,
24
+ textLabel,
25
+ textPlaceholder,
26
+ }: Props) => JSX.Element;
27
+
28
+ // @public (undocumented)
29
+ export enum DismissTrigger {
30
+ // (undocumented)
31
+ AutoDismiss = 'AUTO_DISMISS',
32
+ // (undocumented)
33
+ Finished = 'FINISHED',
34
+ // (undocumented)
35
+ Manual = 'MANUAL',
36
+ // (undocumented)
37
+ Unmount = 'UNMOUNT',
38
+ }
39
+
40
+ // @public (undocumented)
41
+ type FormValues = {
42
+ feedbackScore: number;
43
+ canContact: boolean;
44
+ writtenFeedback: string;
45
+ };
46
+
47
+ // @public (undocumented)
48
+ export type OnDismissArgs = {
49
+ trigger: DismissTrigger;
50
+ };
51
+
52
+ // @public (undocumented)
53
+ interface Props {
54
+ getUserHasAnsweredMailingList: () => Promise<boolean>;
55
+ onDismiss: (args: OnDismissArgs) => void;
56
+ onMailingListAnswer: (answer: boolean) => Promise<void>;
57
+ onSubmit: (formValues: FormValues) => Promise<void>;
58
+ question: string;
59
+ statement?: string;
60
+ textLabel?: string;
61
+ textPlaceholder?: string;
62
+ }
63
+
64
+ // @public (undocumented)
65
+ type Props_2 = {
66
+ shouldShow: boolean;
67
+ children: () => ReactNode;
68
+ };
69
+
70
+ // @public (undocumented)
71
+ export function SurveyMarshal(props: Props_2): JSX.Element;
72
+
73
+ // (No @packageDocumentation comment for this package)
74
+ ```
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/types.js",
5
5
  "module:es2019": "../dist/es2019/types.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/types.d.ts"
7
+ "types": "../dist/types/types.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/types.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }