@atlaskit/flag 14.7.2 → 15.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 (57) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/cjs/auto-dismiss-flag.js +1 -1
  3. package/dist/cjs/flag-actions.js +18 -37
  4. package/dist/cjs/flag-group.js +15 -9
  5. package/dist/cjs/flag.js +62 -69
  6. package/dist/cjs/internal/dismiss-button.js +25 -38
  7. package/dist/cjs/internal/expander.js +25 -26
  8. package/dist/cjs/internal/index.js +0 -16
  9. package/dist/cjs/theme.js +50 -169
  10. package/dist/cjs/version.json +1 -1
  11. package/dist/es2019/auto-dismiss-flag.js +1 -1
  12. package/dist/es2019/flag-actions.js +18 -38
  13. package/dist/es2019/flag-group.js +14 -8
  14. package/dist/es2019/flag.js +62 -67
  15. package/dist/es2019/internal/dismiss-button.js +26 -36
  16. package/dist/es2019/internal/expander.js +20 -23
  17. package/dist/es2019/internal/index.js +0 -2
  18. package/dist/es2019/theme.js +47 -141
  19. package/dist/es2019/version.json +1 -1
  20. package/dist/esm/auto-dismiss-flag.js +1 -1
  21. package/dist/esm/flag-actions.js +18 -38
  22. package/dist/esm/flag-group.js +14 -8
  23. package/dist/esm/flag.js +62 -68
  24. package/dist/esm/internal/dismiss-button.js +26 -37
  25. package/dist/esm/internal/expander.js +21 -24
  26. package/dist/esm/internal/index.js +0 -2
  27. package/dist/esm/theme.js +49 -155
  28. package/dist/esm/version.json +1 -1
  29. package/dist/types/flag-actions.d.ts +2 -5
  30. package/dist/types/flag.d.ts +3 -2
  31. package/dist/types/internal/expander.d.ts +2 -3
  32. package/dist/types/internal/index.d.ts +0 -2
  33. package/dist/types/theme.d.ts +14 -9
  34. package/package.json +9 -15
  35. package/report.api.md +62 -148
  36. package/dist/cjs/internal/description.js +0 -34
  37. package/dist/cjs/internal/title.js +0 -30
  38. package/dist/es2019/internal/description.js +0 -24
  39. package/dist/es2019/internal/title.js +0 -20
  40. package/dist/esm/internal/description.js +0 -25
  41. package/dist/esm/internal/title.js +0 -21
  42. package/dist/types/internal/description.d.ts +0 -8
  43. package/dist/types/internal/title.d.ts +0 -6
  44. package/dist/types-ts4.0/auto-dismiss-flag.d.ts +0 -13
  45. package/dist/types-ts4.0/constants.d.ts +0 -2
  46. package/dist/types-ts4.0/flag-actions.d.ts +0 -15
  47. package/dist/types-ts4.0/flag-group.d.ts +0 -45
  48. package/dist/types-ts4.0/flag-provider.d.ts +0 -33
  49. package/dist/types-ts4.0/flag.d.ts +0 -14
  50. package/dist/types-ts4.0/index.d.ts +0 -6
  51. package/dist/types-ts4.0/internal/description.d.ts +0 -8
  52. package/dist/types-ts4.0/internal/dismiss-button.d.ts +0 -12
  53. package/dist/types-ts4.0/internal/expander.d.ts +0 -8
  54. package/dist/types-ts4.0/internal/index.d.ts +0 -4
  55. package/dist/types-ts4.0/internal/title.d.ts +0 -6
  56. package/dist/types-ts4.0/theme.d.ts +0 -10
  57. package/dist/types-ts4.0/types.d.ts +0 -101
package/report.api.md CHANGED
@@ -1,14 +1,24 @@
1
- ## API Report File for "@atlaskit/flag".
1
+ <!-- API Report Version: 2.2 -->
2
2
 
3
- > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
3
+ ## API Report File for "@atlaskit/flag"
4
4
 
5
- [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
5
+ > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
6
+ > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
+
8
+ ### Table of contents
9
+
10
+ - [Main Entry Types](#main-entry-types)
11
+
12
+ ### Main Entry Types
13
+
14
+ <!--SECTION START: Main Entry Types-->
6
15
 
7
16
  ```ts
8
17
  /// <reference types="react" />
9
18
 
10
19
  import { ComponentType } from 'react';
11
20
  import { CustomThemeButtonProps } from '@atlaskit/button/types';
21
+ import { FC } from 'react';
12
22
  import { jsx } from '@emotion/react';
13
23
  import { MouseEventHandler } from 'react';
14
24
  import { default as React_2 } from 'react';
@@ -17,9 +27,11 @@ import { ReactNode } from 'react';
17
27
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
18
28
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
19
29
 
20
- export declare type ActionsType = Array<ActionType>;
30
+ // @public (undocumented)
31
+ export type ActionsType = Array<ActionType>;
21
32
 
22
- declare type ActionType = {
33
+ // @public (undocumented)
34
+ type ActionType = {
23
35
  content: ReactNode;
24
36
  onClick?: (
25
37
  e: React.MouseEvent<HTMLElement>,
@@ -30,217 +42,119 @@ declare type ActionType = {
30
42
  testId?: string;
31
43
  };
32
44
 
33
- export declare type AppearanceTypes =
45
+ // @public (undocumented)
46
+ export type AppearanceTypes =
34
47
  | 'error'
35
48
  | 'info'
36
49
  | 'normal'
37
50
  | 'success'
38
51
  | 'warning';
39
52
 
40
- /**
41
- * __Auto dismiss flag__
42
- *
43
- * An auto dismiss flag is dismissed automatically after eight seconds.
44
- *
45
- * - [Examples](https://atlassian.design/components/flag/auto-dismiss-flag/examples)
46
- * - [Code](https://atlassian.design/components/flag/auto-dismiss-flag/code)
47
- */
48
- export declare const AutoDismissFlag: (
49
- props: AutoDismissFlagProps,
50
- ) => JSX.Element;
51
-
52
- declare interface AutoDismissFlagProps
53
+ // @public
54
+ export const AutoDismissFlag: (props: AutoDismissFlagProps) => JSX.Element;
55
+
56
+ // @public (undocumented)
57
+ interface AutoDismissFlagProps
53
58
  extends AutoDismissFlagPropsWithoutId,
54
59
  FlagPropsId {}
55
60
 
56
- declare type AutoDismissFlagPropsWithoutId = {
57
- /**
58
- * Array of clickable actions to be shown at the bottom of the flag. For flags where appearance
59
- * is 'normal', actions will be shown as links. For all other appearance values, actions will
60
- * shown as buttons.
61
- * If href is passed the action will be shown as a link with the passed href prop.
62
- */
61
+ // @public (undocumented)
62
+ type AutoDismissFlagPropsWithoutId = {
63
63
  actions?: ActionsType;
64
- /**
65
- * Makes the flag appearance bold. Setting this to anything other than 'normal' hides the
66
- * dismiss button.
67
- */
68
64
  appearance?: AppearanceTypes;
69
- /**
70
- * The secondary content shown below the flag title
71
- */
72
65
  description?: ReactNode;
73
- /**
74
- * The icon displayed in the top-left of the flag. Should be an instance of `@atlaskit/icon`.
75
- * Your icon will receive the appropriate default color, which you can override by wrapping the
76
- * icon in a containing element with CSS `color` set to your preferred icon color.
77
- */
78
66
  icon: ReactNode;
79
- /**
80
- * The bold text shown at the top of the flag.
81
- */
82
67
  title: ReactNode;
83
- /**
84
- * Handler which will be called when a Flag's dismiss button is clicked.
85
- * Receives the id of the dismissed Flag as a parameter.
86
- */
87
68
  onDismissed?: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
88
- /**
89
- * A link component that is passed down to the `@atlaskit/button` used by actions,
90
- * to allow custom routers to be used. See the
91
- * [button with router](https://atlaskit.atlassian.com/packages/design-system/button/example/ButtonWithRouter)
92
- * example of what this component should look like.
93
- */
94
69
  linkComponent?: ComponentType<CustomThemeButtonProps>;
95
- /**
96
- * A `testId` prop is provided for specified elements,
97
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
98
- * serving as a hook for automated tests.
99
- *
100
- * Will set these elements when defined:
101
- *
102
- * - Flag root element - `{testId}`
103
- * - Close button visible on default flags - `{testId}-dismiss`
104
- * - Toggle button visible on bold flags - `{testId}-toggle`
105
- * - Flag content which wraps the description and actions - `{testId}-expander`
106
- * - Flag description - `{testId}-description`
107
- * - Flag actions - `{testId}-actions`
108
- */
109
70
  testId?: string;
110
- /**
111
- * Additional information to be included in the `context` of analytics events that come from flag
112
- */
113
71
  analyticsContext?: Record<string, any>;
114
72
  };
115
73
 
116
- declare type Combine<First, Second> = Omit<First, keyof Second> & Second;
74
+ // @public (undocumented)
75
+ type Combine<First, Second> = Omit<First, keyof Second> & Second;
117
76
 
118
- export declare interface CreateFlagArgs extends FlagPropsWithoutId {
119
- /**
120
- * A unique identifier used for rendering and onDismissed callbacks.
121
- * This will be autogenerated if you don’t supply one.
122
- * If you don’t want the same flag showing multiple times, provide a unique id.
123
- */
77
+ // @public (undocumented)
78
+ export interface CreateFlagArgs extends FlagPropsWithoutId {
124
79
  id?: FlagId;
125
- /**
126
- * Marks whether the flag should render as an AutoDismissFlag
127
- */
128
80
  isAutoDismiss?: boolean;
129
81
  }
130
82
 
131
- export declare type DismissFn = () => void;
132
-
133
- /**
134
- * __Flag__
135
- *
136
- * A flag is used for confirmations, alerts, and acknowledgments that require minimal user interaction,
137
- * often displayed using a flag group.
138
- *
139
- * - [Examples](https://atlassian.design/components/flag/examples)
140
- * - [Code](https://atlassian.design/components/flag/code)
141
- * - [Usage](https://atlassian.design/components/flag/usage)
142
- */
143
- declare const Flag: (props: FlagProps) => jsx.JSX.Element;
83
+ // @public (undocumented)
84
+ export type DismissFn = () => void;
85
+
86
+ // @public
87
+ const Flag: FC<FlagProps>;
144
88
  export default Flag;
145
89
 
146
- export declare type FlagAPI = {
90
+ // @public (undocumented)
91
+ export type FlagAPI = {
147
92
  showFlag: (args: CreateFlagArgs) => DismissFn;
148
93
  };
149
94
 
150
- export declare type FlagArgs = Combine<
95
+ // @public (undocumented)
96
+ export type FlagArgs = Combine<
151
97
  CreateFlagArgs,
152
98
  {
153
99
  id: FlagId;
154
100
  }
155
101
  >;
156
102
 
157
- /**
158
- * __Flag group__
159
- *
160
- * A flag group is used to group a set of related flags, with entry and exit animations.
161
- *
162
- * - [Examples](https://atlassian.design/components/flag/flag-group/examples)
163
- * - [Code](https://atlassian.design/components/flag/flag-group/code)
164
- */
165
- export declare const FlagGroup: (props: FlagGroupProps) => jsx.JSX.Element;
166
-
167
- declare type FlagGroupProps = {
168
- /**
169
- * ID attribute used for DOM selection.
170
- */
103
+ // @public
104
+ export const FlagGroup: (props: FlagGroupProps) => jsx.JSX.Element;
105
+
106
+ // @public (undocumented)
107
+ type FlagGroupProps = {
171
108
  id?: string;
172
- /**
173
- * Describes the specific role of this FlagGroup for users viewing the page with a screen reader (defaults to `Flag notifications`).
174
- */
175
109
  label?: string;
176
- /**
177
- * Describes the specific tag on which the screen reader text will be rendered (defaults to `h2`).
178
- */
179
110
  labelTag?: React.ElementType;
180
- /**
181
- * Flag elements to be displayed.
182
- */
183
- children?: Array<ReactElement> | ReactElement | null | boolean;
184
- /**
185
- * Handler which will be called when a Flag's dismiss button is clicked.
186
- * Receives the id of the dismissed Flag as a parameter.
187
- */
111
+ children?: Array<ReactElement> | ReactElement | boolean | null;
188
112
  onDismissed?: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
189
113
  };
190
114
 
191
- declare type FlagId = string | number;
115
+ // @public (undocumented)
116
+ type FlagId = number | string;
192
117
 
193
- export declare interface FlagProps extends FlagPropsWithoutId, FlagPropsId {}
118
+ // @public (undocumented)
119
+ export interface FlagProps extends FlagPropsWithoutId, FlagPropsId {}
194
120
 
195
- declare type FlagPropsId = {
196
- /**
197
- * A unique identifier used for rendering and onDismissed callbacks.
198
- */
121
+ // @public (undocumented)
122
+ type FlagPropsId = {
199
123
  id: number | string;
200
124
  };
201
125
 
202
- declare interface FlagPropsWithoutId
126
+ // @public (undocumented)
127
+ interface FlagPropsWithoutId
203
128
  extends AutoDismissFlagPropsWithoutId,
204
129
  WithAnalyticsEventsProps {
205
- /**
206
- * Standard onBlur event, applied to Flag by AutoDismissFlag
207
- */
208
130
  onBlur?: (
209
131
  e: React.FocusEvent<HTMLElement>,
210
132
  analyticsEvent: UIAnalyticsEvent,
211
133
  ) => void;
212
- /**
213
- * Standard onFocus event, applied to Flag by AutoDismissFlag
214
- */
215
134
  onFocus?: (
216
135
  e: React.FocusEvent<HTMLElement>,
217
136
  analyticsEvent: UIAnalyticsEvent,
218
137
  ) => void;
219
- /**
220
- * Standard onMouseOut event, applied to Flag by AutoDismissFlag
221
- */
222
138
  onMouseOut?: MouseEventHandler;
223
- /**
224
- * Standard onMouseOver event, applied to Flag by AutoDismissFlag
225
- */
226
139
  onMouseOver?: MouseEventHandler;
227
140
  }
228
141
 
229
- export declare function FlagsProvider({
142
+ // @public (undocumented)
143
+ export function FlagsProvider({
230
144
  children,
231
145
  }: {
232
146
  children: React_2.ReactNode;
233
147
  }): JSX.Element;
234
148
 
235
- /**
236
- * useFlags is used to access the `showFlags` function which can be used to programatically display flags.
237
- * - [Examples](https://atlassian.design/components/flag/flags-provider/examples#using-showflags)
238
- */
239
- export declare function useFlags(): FlagAPI;
149
+ // @public
150
+ export function useFlags(): FlagAPI;
240
151
 
241
- export declare const withFlagsProvider: (
152
+ // @public (undocumented)
153
+ export const withFlagsProvider: (
242
154
  fn: () => React_2.ReactNode,
243
155
  ) => React_2.ReactNode;
244
156
 
245
- export {};
157
+ // (No @packageDocumentation comment for this package)
246
158
  ```
159
+
160
+ <!--SECTION END: Main Entry Types-->
@@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = require("@emotion/react");
9
-
10
- /** @jsx jsx */
11
- var descriptionStyles = (0, _react.css)({
12
- maxHeight: 100,
13
- // height is defined as 5 lines maximum by design
14
- overflow: 'auto',
15
- wordWrap: 'break-word'
16
- });
17
-
18
- var Description = function Description(_ref) {
19
- var color = _ref.color,
20
- testId = _ref.testId,
21
- children = _ref.children,
22
- isBold = _ref.isBold;
23
- return (0, _react.jsx)("div", {
24
- style: {
25
- color: color
26
- },
27
- css: [descriptionStyles],
28
- "data-testid": testId
29
- }, children);
30
- }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
31
-
32
-
33
- var _default = Description;
34
- exports.default = _default;
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = require("@emotion/react");
9
-
10
- /** @jsx jsx */
11
- var titleStyles = (0, _react.css)({
12
- padding: "2px 0 6px 16px",
13
- flex: 1,
14
- fontWeight: 600
15
- });
16
-
17
- var Title = function Title(_ref) {
18
- var color = _ref.color,
19
- children = _ref.children;
20
- return (0, _react.jsx)("span", {
21
- style: {
22
- color: color
23
- },
24
- css: titleStyles
25
- }, children);
26
- }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
27
-
28
-
29
- var _default = Title;
30
- exports.default = _default;
@@ -1,24 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx, css } from '@emotion/react';
3
- const descriptionStyles = css({
4
- maxHeight: 100,
5
- // height is defined as 5 lines maximum by design
6
- overflow: 'auto',
7
- wordWrap: 'break-word'
8
- });
9
-
10
- const Description = ({
11
- color,
12
- testId,
13
- children,
14
- isBold
15
- }) => jsx("div", {
16
- style: {
17
- color
18
- },
19
- css: [descriptionStyles],
20
- "data-testid": testId
21
- }, children); // eslint-disable-next-line @repo/internal/react/require-jsdoc
22
-
23
-
24
- export default Description;
@@ -1,20 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx, css } from '@emotion/react';
3
- const titleStyles = css({
4
- padding: `2px 0 6px 16px`,
5
- flex: 1,
6
- fontWeight: 600
7
- });
8
-
9
- const Title = ({
10
- color,
11
- children
12
- }) => jsx("span", {
13
- style: {
14
- color
15
- },
16
- css: titleStyles
17
- }, children); // eslint-disable-next-line @repo/internal/react/require-jsdoc
18
-
19
-
20
- export default Title;
@@ -1,25 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx, css } from '@emotion/react';
3
- var descriptionStyles = css({
4
- maxHeight: 100,
5
- // height is defined as 5 lines maximum by design
6
- overflow: 'auto',
7
- wordWrap: 'break-word'
8
- });
9
-
10
- var Description = function Description(_ref) {
11
- var color = _ref.color,
12
- testId = _ref.testId,
13
- children = _ref.children,
14
- isBold = _ref.isBold;
15
- return jsx("div", {
16
- style: {
17
- color: color
18
- },
19
- css: [descriptionStyles],
20
- "data-testid": testId
21
- }, children);
22
- }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
23
-
24
-
25
- export default Description;
@@ -1,21 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx, css } from '@emotion/react';
3
- var titleStyles = css({
4
- padding: "2px 0 6px 16px",
5
- flex: 1,
6
- fontWeight: 600
7
- });
8
-
9
- var Title = function Title(_ref) {
10
- var color = _ref.color,
11
- children = _ref.children;
12
- return jsx("span", {
13
- style: {
14
- color: color
15
- },
16
- css: titleStyles
17
- }, children);
18
- }; // eslint-disable-next-line @repo/internal/react/require-jsdoc
19
-
20
-
21
- export default Title;
@@ -1,8 +0,0 @@
1
- import { FC } from 'react';
2
- interface DescriptionProps {
3
- testId?: string;
4
- color: string;
5
- isBold: boolean;
6
- }
7
- declare const Description: FC<DescriptionProps>;
8
- export default Description;
@@ -1,6 +0,0 @@
1
- import { FC } from 'react';
2
- interface TitleProps {
3
- color: string;
4
- }
5
- declare const Title: FC<TitleProps>;
6
- export default Title;
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- import { AutoDismissFlagProps } from './types';
3
- export declare const AUTO_DISMISS_SECONDS = 8;
4
- /**
5
- * __Auto dismiss flag__
6
- *
7
- * An auto dismiss flag is dismissed automatically after eight seconds.
8
- *
9
- * - [Examples](https://atlassian.design/components/flag/auto-dismiss-flag/examples)
10
- * - [Code](https://atlassian.design/components/flag/auto-dismiss-flag/code)
11
- */
12
- declare const AutoDismissFlag: (props: AutoDismissFlagProps) => JSX.Element;
13
- export default AutoDismissFlag;
@@ -1,2 +0,0 @@
1
- import { AppearanceTypes } from './types';
2
- export declare const DEFAULT_APPEARANCE: AppearanceTypes;
@@ -1,15 +0,0 @@
1
- /** @jsx jsx */
2
- import type { ComponentType } from 'react';
3
- import { jsx } from '@emotion/react';
4
- import type { CustomThemeButtonProps } from '@atlaskit/button/types';
5
- import type { ThemeModes } from '@atlaskit/theme/types';
6
- import type { ActionsType, AppearanceTypes } from './types';
7
- declare type FlagActionsProps = {
8
- appearance: AppearanceTypes;
9
- actions: ActionsType;
10
- linkComponent?: ComponentType<CustomThemeButtonProps>;
11
- mode: ThemeModes;
12
- testId?: string;
13
- };
14
- declare const FlagActions: (props: FlagActionsProps) => jsx.JSX.Element | null;
15
- export default FlagActions;
@@ -1,45 +0,0 @@
1
- /** @jsx jsx */
2
- import { ReactElement } from 'react';
3
- import { jsx } from '@emotion/react';
4
- import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
5
- declare type FlagGroupProps = {
6
- /**
7
- * ID attribute used for DOM selection.
8
- */
9
- id?: string;
10
- /**
11
- * Describes the specific role of this FlagGroup for users viewing the page with a screen reader (defaults to `Flag notifications`).
12
- */
13
- label?: string;
14
- /**
15
- * Describes the specific tag on which the screen reader text will be rendered (defaults to `h2`).
16
- */
17
- labelTag?: React.ElementType;
18
- /**
19
- * Flag elements to be displayed.
20
- */
21
- children?: Array<ReactElement> | ReactElement | null | boolean;
22
- /**
23
- * Handler which will be called when a Flag's dismiss button is clicked.
24
- * Receives the id of the dismissed Flag as a parameter.
25
- */
26
- onDismissed?: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
27
- };
28
- export declare const flagWidth: number;
29
- export declare const flagAnimationTime = 400;
30
- declare type FlagGroupAPI = {
31
- onDismissed: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
32
- isDismissAllowed: boolean;
33
- };
34
- export declare const FlagGroupContext: import("react").Context<FlagGroupAPI>;
35
- export declare function useFlagGroup(): FlagGroupAPI;
36
- /**
37
- * __Flag group__
38
- *
39
- * A flag group is used to group a set of related flags, with entry and exit animations.
40
- *
41
- * - [Examples](https://atlassian.design/components/flag/flag-group/examples)
42
- * - [Code](https://atlassian.design/components/flag/flag-group/code)
43
- */
44
- declare const FlagGroup: (props: FlagGroupProps) => jsx.JSX.Element;
45
- export default FlagGroup;
@@ -1,33 +0,0 @@
1
- import React from 'react';
2
- import { FlagPropsWithoutId } from './types';
3
- declare type FlagId = string | number;
4
- export declare type Combine<First, Second> = Omit<First, keyof Second> & Second;
5
- export interface CreateFlagArgs extends FlagPropsWithoutId {
6
- /**
7
- * A unique identifier used for rendering and onDismissed callbacks.
8
- * This will be autogenerated if you don’t supply one.
9
- * If you don’t want the same flag showing multiple times, provide a unique id.
10
- */
11
- id?: FlagId;
12
- /**
13
- * Marks whether the flag should render as an AutoDismissFlag
14
- */
15
- isAutoDismiss?: boolean;
16
- }
17
- export declare type FlagArgs = Combine<CreateFlagArgs, {
18
- id: FlagId;
19
- }>;
20
- export declare type DismissFn = () => void;
21
- export declare type FlagAPI = {
22
- showFlag: (args: CreateFlagArgs) => DismissFn;
23
- };
24
- /**
25
- * useFlags is used to access the `showFlags` function which can be used to programatically display flags.
26
- * - [Examples](https://atlassian.design/components/flag/flags-provider/examples#using-showflags)
27
- */
28
- export declare function useFlags(): FlagAPI;
29
- export declare function FlagsProvider({ children }: {
30
- children: React.ReactNode;
31
- }): JSX.Element;
32
- export declare const withFlagsProvider: (fn: () => React.ReactNode) => React.ReactNode;
33
- export {};
@@ -1,14 +0,0 @@
1
- import { jsx } from '@emotion/react';
2
- import type { FlagProps } from './types';
3
- /**
4
- * __Flag__
5
- *
6
- * A flag is used for confirmations, alerts, and acknowledgments that require minimal user interaction,
7
- * often displayed using a flag group.
8
- *
9
- * - [Examples](https://atlassian.design/components/flag/examples)
10
- * - [Code](https://atlassian.design/components/flag/code)
11
- * - [Usage](https://atlassian.design/components/flag/usage)
12
- */
13
- declare const Flag: (props: FlagProps) => jsx.JSX.Element;
14
- export default Flag;
@@ -1,6 +0,0 @@
1
- export { default } from './flag';
2
- export { default as AutoDismissFlag } from './auto-dismiss-flag';
3
- export { default as FlagGroup } from './flag-group';
4
- export { useFlags, withFlagsProvider, FlagsProvider } from './flag-provider';
5
- export type { CreateFlagArgs, DismissFn, FlagAPI, FlagArgs, } from './flag-provider';
6
- export type { FlagProps, ActionsType, AppearanceTypes } from './types';
@@ -1,8 +0,0 @@
1
- import { FC } from 'react';
2
- interface DescriptionProps {
3
- testId?: string;
4
- color: string;
5
- isBold: boolean;
6
- }
7
- declare const Description: FC<DescriptionProps>;
8
- export default Description;
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { jsx } from '@emotion/react';
3
- import { AppearanceTypes } from '../types';
4
- interface DismissButtonProps {
5
- appearance: AppearanceTypes;
6
- onClick: (...args: any) => void;
7
- isExpanded: boolean;
8
- isBold: boolean;
9
- testId?: string;
10
- }
11
- declare const _default: import("react").MemoExoticComponent<({ appearance, onClick, isBold, isExpanded, testId, }: DismissButtonProps) => jsx.JSX.Element>;
12
- export default _default;
@@ -1,8 +0,0 @@
1
- /** @jsx jsx */
2
- import { FC } from 'react';
3
- declare type ExpanderProps = {
4
- isExpanded: boolean;
5
- testId?: string;
6
- };
7
- declare const Expander: FC<ExpanderProps>;
8
- export default Expander;
@@ -1,4 +0,0 @@
1
- export { default as Title } from './title';
2
- export { default as Description } from './description';
3
- export { default as Expander } from './expander';
4
- export { default as DismissButton } from './dismiss-button';
@@ -1,6 +0,0 @@
1
- import { FC } from 'react';
2
- interface TitleProps {
3
- color: string;
4
- }
5
- declare const Title: FC<TitleProps>;
6
- export default Title;