@atlaskit/flag 15.5.2 → 15.6.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 (41) hide show
  1. package/CHANGELOG.md +1026 -1010
  2. package/README.md +2 -1
  3. package/__perf__/autodismiss.tsx +10 -10
  4. package/__perf__/default.tsx +10 -10
  5. package/__perf__/with-flag-group.tsx +11 -16
  6. package/dist/cjs/auto-dismiss-flag.js +1 -1
  7. package/dist/cjs/flag-actions.js +23 -4
  8. package/dist/cjs/flag-group.js +16 -2
  9. package/dist/cjs/flag.js +8 -3
  10. package/dist/cjs/internal/expander.js +2 -0
  11. package/dist/es2019/auto-dismiss-flag.js +1 -1
  12. package/dist/es2019/flag-actions.js +27 -4
  13. package/dist/es2019/flag-group.js +16 -2
  14. package/dist/es2019/flag.js +10 -2
  15. package/dist/es2019/internal/expander.js +2 -0
  16. package/dist/esm/auto-dismiss-flag.js +1 -1
  17. package/dist/esm/flag-actions.js +22 -4
  18. package/dist/esm/flag-group.js +16 -2
  19. package/dist/esm/flag.js +10 -2
  20. package/dist/esm/internal/expander.js +2 -0
  21. package/dist/types/auto-dismiss-flag.d.ts +1 -1
  22. package/dist/types/constants.d.ts +1 -1
  23. package/dist/types/flag-actions.d.ts +4 -1
  24. package/dist/types/flag-group.d.ts +1 -1
  25. package/dist/types/flag.d.ts +4 -1
  26. package/dist/types/index.d.ts +1 -1
  27. package/dist/types/internal/dismiss-button.d.ts +1 -1
  28. package/dist/types/theme.d.ts +2 -2
  29. package/dist/types/types.d.ts +3 -3
  30. package/dist/types-ts4.5/auto-dismiss-flag.d.ts +1 -1
  31. package/dist/types-ts4.5/constants.d.ts +1 -1
  32. package/dist/types-ts4.5/flag-actions.d.ts +4 -1
  33. package/dist/types-ts4.5/flag-group.d.ts +1 -1
  34. package/dist/types-ts4.5/flag.d.ts +4 -1
  35. package/dist/types-ts4.5/index.d.ts +1 -1
  36. package/dist/types-ts4.5/internal/dismiss-button.d.ts +1 -1
  37. package/dist/types-ts4.5/theme.d.ts +2 -2
  38. package/dist/types-ts4.5/types.d.ts +3 -3
  39. package/extract-react-types/show-flag-args.tsx +2 -2
  40. package/package.json +108 -110
  41. package/report.api.md +39 -62
package/report.api.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  ## API Report File for "@atlaskit/flag"
4
4
 
5
- > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
5
+ > Do not edit this file. This report is auto-generated using
6
+ > [API Extractor](https://api-extractor.com/).
6
7
  > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
8
 
8
9
  ### Table of contents
@@ -33,43 +34,33 @@ export type ActionsType = Array<ActionType>;
33
34
 
34
35
  // @public (undocumented)
35
36
  type ActionType = {
36
- content: ReactNode;
37
- onClick?: (
38
- e: React.MouseEvent<HTMLElement>,
39
- analyticsEvent: UIAnalyticsEvent,
40
- ) => void;
41
- href?: string;
42
- target?: string;
43
- testId?: string;
37
+ content: ReactNode;
38
+ onClick?: (e: React.MouseEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
39
+ href?: string;
40
+ target?: string;
41
+ testId?: string;
44
42
  };
45
43
 
46
44
  // @public (undocumented)
47
- export type AppearanceTypes =
48
- | 'error'
49
- | 'info'
50
- | 'normal'
51
- | 'success'
52
- | 'warning';
45
+ export type AppearanceTypes = 'error' | 'info' | 'normal' | 'success' | 'warning';
53
46
 
54
47
  // @public
55
48
  export const AutoDismissFlag: (props: AutoDismissFlagProps) => JSX.Element;
56
49
 
57
50
  // @public (undocumented)
58
- interface AutoDismissFlagProps
59
- extends AutoDismissFlagPropsWithoutId,
60
- FlagPropsId {}
51
+ interface AutoDismissFlagProps extends AutoDismissFlagPropsWithoutId, FlagPropsId {}
61
52
 
62
53
  // @public (undocumented)
63
54
  type AutoDismissFlagPropsWithoutId = {
64
- actions?: ActionsType;
65
- appearance?: AppearanceTypes;
66
- description?: ReactNode;
67
- icon: ReactNode;
68
- title: ReactNode;
69
- onDismissed?: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
70
- linkComponent?: ComponentType<CustomThemeButtonProps>;
71
- testId?: string;
72
- analyticsContext?: Record<string, any>;
55
+ actions?: ActionsType;
56
+ appearance?: AppearanceTypes;
57
+ description?: ReactNode;
58
+ icon: ReactNode;
59
+ title: ReactNode;
60
+ onDismissed?: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
61
+ linkComponent?: ComponentType<CustomThemeButtonProps>;
62
+ testId?: string;
63
+ analyticsContext?: Record<string, any>;
73
64
  };
74
65
 
75
66
  // @public (undocumented)
@@ -77,8 +68,8 @@ type Combine<First, Second> = Omit<First, keyof Second> & Second;
77
68
 
78
69
  // @public (undocumented)
79
70
  export interface CreateFlagArgs extends FlagPropsWithoutId {
80
- id?: FlagId;
81
- isAutoDismiss?: boolean;
71
+ id?: FlagId;
72
+ isAutoDismiss?: boolean;
82
73
  }
83
74
 
84
75
  // @public (undocumented)
@@ -90,15 +81,15 @@ export default Flag;
90
81
 
91
82
  // @public (undocumented)
92
83
  export type FlagAPI = {
93
- showFlag: (args: CreateFlagArgs) => DismissFn;
84
+ showFlag: (args: CreateFlagArgs) => DismissFn;
94
85
  };
95
86
 
96
87
  // @public (undocumented)
97
88
  export type FlagArgs = Combine<
98
- CreateFlagArgs,
99
- {
100
- id: FlagId;
101
- }
89
+ CreateFlagArgs,
90
+ {
91
+ id: FlagId;
92
+ }
102
93
  >;
103
94
 
104
95
  // @public
@@ -106,11 +97,11 @@ export const FlagGroup: (props: FlagGroupProps) => jsx.JSX.Element;
106
97
 
107
98
  // @public (undocumented)
108
99
  type FlagGroupProps = {
109
- id?: string;
110
- label?: string;
111
- labelTag?: React.ElementType;
112
- children?: Array<ReactElement> | ReactElement | boolean | null;
113
- onDismissed?: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
100
+ id?: string;
101
+ label?: string;
102
+ labelTag?: React.ElementType;
103
+ children?: Array<ReactElement> | ReactElement | boolean | null;
104
+ onDismissed?: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
114
105
  };
115
106
 
116
107
  // @public (undocumented)
@@ -121,39 +112,25 @@ export interface FlagProps extends FlagPropsWithoutId, FlagPropsId {}
121
112
 
122
113
  // @public (undocumented)
123
114
  type FlagPropsId = {
124
- id: number | string;
115
+ id: number | string;
125
116
  };
126
117
 
127
118
  // @public (undocumented)
128
- interface FlagPropsWithoutId
129
- extends AutoDismissFlagPropsWithoutId,
130
- WithAnalyticsEventsProps {
131
- onBlur?: (
132
- e: React.FocusEvent<HTMLElement>,
133
- analyticsEvent: UIAnalyticsEvent,
134
- ) => void;
135
- onFocus?: (
136
- e: React.FocusEvent<HTMLElement>,
137
- analyticsEvent: UIAnalyticsEvent,
138
- ) => void;
139
- onMouseOut?: MouseEventHandler;
140
- onMouseOver?: MouseEventHandler;
119
+ interface FlagPropsWithoutId extends AutoDismissFlagPropsWithoutId, WithAnalyticsEventsProps {
120
+ onBlur?: (e: React.FocusEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
121
+ onFocus?: (e: React.FocusEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
122
+ onMouseOut?: MouseEventHandler;
123
+ onMouseOver?: MouseEventHandler;
141
124
  }
142
125
 
143
126
  // @public (undocumented)
144
- export function FlagsProvider({
145
- children,
146
- }: {
147
- children: React_2.ReactNode;
148
- }): JSX.Element;
127
+ export function FlagsProvider({ children }: { children: React_2.ReactNode }): JSX.Element;
149
128
 
150
129
  // @public
151
130
  export function useFlags(): FlagAPI;
152
131
 
153
132
  // @public (undocumented)
154
- export const withFlagsProvider: (
155
- fn: () => React_2.ReactNode,
156
- ) => React_2.ReactNode;
133
+ export const withFlagsProvider: (fn: () => React_2.ReactNode) => React_2.ReactNode;
157
134
 
158
135
  // (No @packageDocumentation comment for this package)
159
136
  ```
@@ -166,7 +143,7 @@ export const withFlagsProvider: (
166
143
 
167
144
  ```json
168
145
  {
169
- "react": "^16.8.0"
146
+ "react": "^16.8.0"
170
147
  }
171
148
  ```
172
149