@atlaskit/contextual-survey 2.2.0 → 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,17 @@
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
+
9
+ ## 2.2.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
14
+
3
15
  ## 2.2.0
4
16
 
5
17
  ### Minor Changes
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/constants.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/constants.d.ts"
11
+ "../dist/types-ts4.5/constants.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/contextual-survey",
3
- "version": "2.2.0",
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.0",
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.0",
3
+ "version": "2.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -6,7 +6,7 @@ export declare enum DismissTrigger {
6
6
  Finished = "FINISHED",
7
7
  Unmount = "UNMOUNT"
8
8
  }
9
- export declare type OnDismissArgs = {
9
+ export type OnDismissArgs = {
10
10
  trigger: DismissTrigger;
11
11
  };
12
12
  interface Props {
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactNode } from 'react';
3
- declare type Props = {
3
+ type Props = {
4
4
  /** Whether the form should be rendered */
5
5
  shouldShow: boolean;
6
6
  /** A function that returns Node to be rendered (`<ContextualSurvey/>`)
@@ -1,5 +1,5 @@
1
1
  export declare const escape: number;
2
- declare type Args = {
2
+ type Args = {
3
3
  onDismiss: () => void;
4
4
  };
5
5
  export default function useEscapeToDismiss({ onDismiss }: Args): void;
@@ -1,4 +1,4 @@
1
- export declare type FormValues = {
1
+ export type FormValues = {
2
2
  feedbackScore: number;
3
3
  canContact: boolean;
4
4
  writtenFeedback: string;
@@ -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.0",
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/"
@@ -12,6 +12,14 @@
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.5 <4.9": {
17
+ "*": [
18
+ "dist/types-ts4.5/*",
19
+ "dist/types-ts4.5/index.d.ts"
20
+ ]
21
+ }
22
+ },
15
23
  "sideEffects": false,
16
24
  "atlaskit:src": "src/index.ts",
17
25
  "atlassian": {
@@ -24,12 +32,12 @@
24
32
  },
25
33
  "dependencies": {
26
34
  "@atlaskit/button": "^16.7.0",
27
- "@atlaskit/checkbox": "^12.5.0",
35
+ "@atlaskit/checkbox": "^12.6.0",
28
36
  "@atlaskit/form": "^8.11.0",
29
37
  "@atlaskit/icon": "^21.12.0",
30
38
  "@atlaskit/textarea": "^4.6.0",
31
39
  "@atlaskit/theme": "^12.5.0",
32
- "@atlaskit/tokens": "^1.3.0",
40
+ "@atlaskit/tokens": "^1.4.0",
33
41
  "@atlaskit/tooltip": "^17.8.0",
34
42
  "@babel/runtime": "^7.0.0",
35
43
  "@emotion/core": "^10.0.9",
@@ -39,11 +47,11 @@
39
47
  "react": "^16.8.0"
40
48
  },
41
49
  "devDependencies": {
42
- "@atlaskit/checkbox": "^12.5.0",
50
+ "@atlaskit/checkbox": "^12.6.0",
43
51
  "@atlaskit/docs": "*",
44
52
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
45
53
  "@testing-library/react": "^12.1.5",
46
- "typescript": "4.5.5"
54
+ "typescript": "~4.9.5"
47
55
  },
48
56
  "keywords": [
49
57
  "atlaskit",
@@ -0,0 +1,61 @@
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
+ ```ts
6
+
7
+ /// <reference types="react" />
8
+
9
+ import { ReactNode } from 'react';
10
+
11
+ // @public (undocumented)
12
+ export const ContextualSurvey: ({ question, statement, onDismiss, onSubmit, onMailingListAnswer, getUserHasAnsweredMailingList, textLabel, textPlaceholder, }: Props) => JSX.Element;
13
+
14
+ // @public (undocumented)
15
+ export enum DismissTrigger {
16
+ // (undocumented)
17
+ AutoDismiss = "AUTO_DISMISS",
18
+ // (undocumented)
19
+ Finished = "FINISHED",
20
+ // (undocumented)
21
+ Manual = "MANUAL",
22
+ // (undocumented)
23
+ Unmount = "UNMOUNT"
24
+ }
25
+
26
+ // @public (undocumented)
27
+ type FormValues = {
28
+ feedbackScore: number;
29
+ canContact: boolean;
30
+ writtenFeedback: string;
31
+ };
32
+
33
+ // @public (undocumented)
34
+ export type OnDismissArgs = {
35
+ trigger: DismissTrigger;
36
+ };
37
+
38
+ // @public (undocumented)
39
+ interface Props {
40
+ getUserHasAnsweredMailingList: () => Promise<boolean>;
41
+ onDismiss: (args: OnDismissArgs) => void;
42
+ onMailingListAnswer: (answer: boolean) => Promise<void>;
43
+ onSubmit: (formValues: FormValues) => Promise<void>;
44
+ question: string;
45
+ statement?: string;
46
+ textLabel?: string;
47
+ textPlaceholder?: string;
48
+ }
49
+
50
+ // @public (undocumented)
51
+ type Props_2 = {
52
+ shouldShow: boolean;
53
+ children: () => ReactNode;
54
+ };
55
+
56
+ // @public (undocumented)
57
+ export function SurveyMarshal(props: Props_2): JSX.Element;
58
+
59
+ // (No @packageDocumentation comment for this package)
60
+
61
+ ```
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/types.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/types.d.ts"
11
+ "../dist/types-ts4.5/types.d.ts"
12
12
  ]
13
13
  }
14
14
  }