@atlaskit/flag 14.7.1 → 14.7.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/flag
2
2
 
3
+ ## 14.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9de88fa1e1e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9de88fa1e1e) - Internal changes to include spacing tokens in component implementations.
8
+
3
9
  ## 14.7.1
4
10
 
5
11
  ### Patch Changes
@@ -26,7 +26,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
26
26
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
27
 
28
28
  var packageName = "@atlaskit/flag";
29
- var packageVersion = "14.7.1";
29
+ var packageVersion = "14.7.2";
30
30
  var AUTO_DISMISS_SECONDS = 8;
31
31
  /**
32
32
  * __Auto dismiss flag__
package/dist/cjs/flag.js CHANGED
@@ -44,7 +44,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
44
44
  var analyticsAttributes = {
45
45
  componentName: 'flag',
46
46
  packageName: "@atlaskit/flag",
47
- packageVersion: "14.7.1"
47
+ packageVersion: "14.7.2"
48
48
  };
49
49
  var gridSize = (0, _constants.gridSize)();
50
50
  var doubleGridSize = gridSize * 2;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "14.7.1",
3
+ "version": "14.7.2",
4
4
  "sideEffects": false
5
5
  }
@@ -5,7 +5,7 @@ import noop from '@atlaskit/ds-lib/noop';
5
5
  import Flag from './flag';
6
6
  import { useFlagGroup } from './flag-group';
7
7
  const packageName = "@atlaskit/flag";
8
- const packageVersion = "14.7.1";
8
+ const packageVersion = "14.7.2";
9
9
  export const AUTO_DISMISS_SECONDS = 8;
10
10
  /**
11
11
  * __Auto dismiss flag__
@@ -16,7 +16,7 @@ import { Title, Description, Expander, DismissButton } from './internal';
16
16
  const analyticsAttributes = {
17
17
  componentName: 'flag',
18
18
  packageName: "@atlaskit/flag",
19
- packageVersion: "14.7.1"
19
+ packageVersion: "14.7.2"
20
20
  };
21
21
  const gridSize = getGridSize();
22
22
  const doubleGridSize = gridSize * 2;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "14.7.1",
3
+ "version": "14.7.2",
4
4
  "sideEffects": false
5
5
  }
@@ -5,7 +5,7 @@ import noop from '@atlaskit/ds-lib/noop';
5
5
  import Flag from './flag';
6
6
  import { useFlagGroup } from './flag-group';
7
7
  var packageName = "@atlaskit/flag";
8
- var packageVersion = "14.7.1";
8
+ var packageVersion = "14.7.2";
9
9
  export var AUTO_DISMISS_SECONDS = 8;
10
10
  /**
11
11
  * __Auto dismiss flag__
package/dist/esm/flag.js CHANGED
@@ -22,7 +22,7 @@ import { Title, Description, Expander, DismissButton } from './internal';
22
22
  var analyticsAttributes = {
23
23
  componentName: 'flag',
24
24
  packageName: "@atlaskit/flag",
25
- packageVersion: "14.7.1"
25
+ packageVersion: "14.7.2"
26
26
  };
27
27
  var gridSize = getGridSize();
28
28
  var doubleGridSize = gridSize * 2;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "14.7.1",
3
+ "version": "14.7.2",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "14.7.1",
3
+ "version": "14.7.2",
4
4
  "description": "A flag is used for confirmations, alerts, and acknowledgments that require minimal user interaction, often displayed using a flag group.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -15,13 +15,15 @@
15
15
  "typesVersions": {
16
16
  ">=4.0 <4.5": {
17
17
  "*": [
18
- "dist/types-ts4.0/*"
18
+ "dist/types-ts4.0/*",
19
+ "dist/types-ts4.0/index.d.ts"
19
20
  ]
20
21
  }
21
22
  },
22
23
  "sideEffects": false,
23
24
  "atlaskit:src": "src/index.tsx",
24
25
  "atlassian": {
26
+ "disableProductCI": true,
25
27
  "team": "Design System Team",
26
28
  "releaseModel": "scheduled",
27
29
  "website": {
@@ -44,8 +46,8 @@
44
46
  "@atlaskit/analytics-next": "^8.0.0",
45
47
  "@atlaskit/button": "^16.3.0",
46
48
  "@atlaskit/ds-lib": "^2.1.0",
47
- "@atlaskit/focus-ring": "^1.0.0",
48
- "@atlaskit/icon": "^21.10.0",
49
+ "@atlaskit/focus-ring": "^1.1.0",
50
+ "@atlaskit/icon": "^21.11.0",
49
51
  "@atlaskit/motion": "^1.2.0",
50
52
  "@atlaskit/portal": "^4.0.0",
51
53
  "@atlaskit/theme": "^12.2.0",
@@ -60,7 +62,7 @@
60
62
  "devDependencies": {
61
63
  "@atlaskit/docs": "*",
62
64
  "@atlaskit/radio": "^5.4.0",
63
- "@atlaskit/section-message": "^6.2.0",
65
+ "@atlaskit/section-message": "^6.3.0",
64
66
  "@atlaskit/spinner": "^15.0.0",
65
67
  "@atlaskit/ssr": "*",
66
68
  "@atlaskit/theme": "^12.2.0",
@@ -83,6 +85,7 @@
83
85
  "@repo/internal": {
84
86
  "dom-events": "use-bind-event-listener",
85
87
  "design-system": "v1",
88
+ "design-tokens": "spacing",
86
89
  "ui-components": [
87
90
  "lite-mode"
88
91
  ],
package/report.api.md CHANGED
@@ -1,12 +1,15 @@
1
- ## API Report File for "@atlaskit/flag"
1
+ ## API Report File for "@atlaskit/flag".
2
2
 
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
4
6
 
5
7
  ```ts
6
8
  /// <reference types="react" />
7
9
 
8
10
  import { ComponentType } from 'react';
9
11
  import { CustomThemeButtonProps } from '@atlaskit/button/types';
12
+ import { jsx } from '@emotion/react';
10
13
  import { MouseEventHandler } from 'react';
11
14
  import { default as React_2 } from 'react';
12
15
  import { ReactElement } from 'react';
@@ -34,6 +37,14 @@ export declare type AppearanceTypes =
34
37
  | 'success'
35
38
  | 'warning';
36
39
 
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
+ */
37
48
  export declare const AutoDismissFlag: (
38
49
  props: AutoDismissFlagProps,
39
50
  ) => JSX.Element;
@@ -43,68 +54,93 @@ declare interface AutoDismissFlagProps
43
54
  FlagPropsId {}
44
55
 
45
56
  declare type AutoDismissFlagPropsWithoutId = {
46
- /** Array of clickable actions to be shown at the bottom of the flag. For flags where appearance
57
+ /**
58
+ * Array of clickable actions to be shown at the bottom of the flag. For flags where appearance
47
59
  * is 'normal', actions will be shown as links. For all other appearance values, actions will
48
60
  * shown as buttons.
49
61
  * If href is passed the action will be shown as a link with the passed href prop.
50
62
  */
51
63
  actions?: ActionsType;
52
- /** Makes the flag appearance bold. Setting this to anything other than 'normal' hides the
64
+ /**
65
+ * Makes the flag appearance bold. Setting this to anything other than 'normal' hides the
53
66
  * dismiss button.
54
67
  */
55
68
  appearance?: AppearanceTypes;
56
- /** The secondary content shown below the flag title */
69
+ /**
70
+ * The secondary content shown below the flag title
71
+ */
57
72
  description?: ReactNode;
58
- /** The icon displayed in the top-left of the flag. Should be an instance of `@atlaskit/icon`.
73
+ /**
74
+ * The icon displayed in the top-left of the flag. Should be an instance of `@atlaskit/icon`.
59
75
  * Your icon will receive the appropriate default color, which you can override by wrapping the
60
76
  * icon in a containing element with CSS `color` set to your preferred icon color.
61
77
  */
62
78
  icon: ReactNode;
63
- /** The bold text shown at the top of the flag. */
79
+ /**
80
+ * The bold text shown at the top of the flag.
81
+ */
64
82
  title: ReactNode;
65
- /** Handler which will be called when a Flag's dismiss button is clicked.
83
+ /**
84
+ * Handler which will be called when a Flag's dismiss button is clicked.
66
85
  * Receives the id of the dismissed Flag as a parameter.
67
86
  */
68
87
  onDismissed?: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
69
- /** A link component that is passed down to the `@atlaskit/button` used by actions,
70
- to allow custom routers to be used. See the
71
- [button with router](https://atlaskit.atlassian.com/packages/design-system/button/example/ButtonWithRouter)
72
- example of what this component should look like. */
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
+ */
73
94
  linkComponent?: ComponentType<CustomThemeButtonProps>;
74
95
  /**
75
- * A `testId` prop is provided for specified elements,
76
- * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
77
- * serving as a hook for automated tests.
78
-
79
- * Will set these elements when defined:
80
-
81
- * - Flag root element - `{testId}`
82
- * - Close button visible on default flags - `{testId}-dismiss`
83
- * - Toggle button visible on bold flags - `{testId}-toggle`
84
- * - Flag content which wraps the description and actions - `{testId}-expander`
85
- * - Flag description - `{testId}-description`
86
- * - Flag actions - `{testId}-actions`
87
- */
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
+ */
88
109
  testId?: string;
89
- /** Additional information to be included in the `context` of analytics events that come from flag */
110
+ /**
111
+ * Additional information to be included in the `context` of analytics events that come from flag
112
+ */
90
113
  analyticsContext?: Record<string, any>;
91
114
  };
92
115
 
93
116
  declare type Combine<First, Second> = Omit<First, keyof Second> & Second;
94
117
 
95
118
  export declare interface CreateFlagArgs extends FlagPropsWithoutId {
96
- /** A unique identifier used for rendering and onDismissed callbacks.
119
+ /**
120
+ * A unique identifier used for rendering and onDismissed callbacks.
97
121
  * This will be autogenerated if you don’t supply one.
98
122
  * If you don’t want the same flag showing multiple times, provide a unique id.
99
123
  */
100
124
  id?: FlagId;
101
- /** Marks whether the flag should render as an AutoDismissFlag */
125
+ /**
126
+ * Marks whether the flag should render as an AutoDismissFlag
127
+ */
102
128
  isAutoDismiss?: boolean;
103
129
  }
104
130
 
105
131
  export declare type DismissFn = () => void;
106
132
 
107
- declare const Flag: (props: FlagProps) => JSX.Element;
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;
108
144
  export default Flag;
109
145
 
110
146
  export declare type FlagAPI = {
@@ -118,18 +154,35 @@ export declare type FlagArgs = Combine<
118
154
  }
119
155
  >;
120
156
 
121
- export declare const FlagGroup: (props: FlagGroupProps) => JSX.Element;
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;
122
166
 
123
167
  declare type FlagGroupProps = {
124
- /** ID attribute used for DOM selection. */
168
+ /**
169
+ * ID attribute used for DOM selection.
170
+ */
125
171
  id?: string;
126
- /** Describes the specific role of this FlagGroup for users viewing the page with a screen reader (defaults to `Flag notifications`). */
172
+ /**
173
+ * Describes the specific role of this FlagGroup for users viewing the page with a screen reader (defaults to `Flag notifications`).
174
+ */
127
175
  label?: string;
128
- /** Describes the specific tag on which the screen reader text will be rendered (defaults to `h2`). */
176
+ /**
177
+ * Describes the specific tag on which the screen reader text will be rendered (defaults to `h2`).
178
+ */
129
179
  labelTag?: React.ElementType;
130
- /** Flag elements to be displayed. */
180
+ /**
181
+ * Flag elements to be displayed.
182
+ */
131
183
  children?: Array<ReactElement> | ReactElement | null | boolean;
132
- /** Handler which will be called when a Flag's dismiss button is clicked.
184
+ /**
185
+ * Handler which will be called when a Flag's dismiss button is clicked.
133
186
  * Receives the id of the dismissed Flag as a parameter.
134
187
  */
135
188
  onDismissed?: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
@@ -140,26 +193,36 @@ declare type FlagId = string | number;
140
193
  export declare interface FlagProps extends FlagPropsWithoutId, FlagPropsId {}
141
194
 
142
195
  declare type FlagPropsId = {
143
- /** A unique identifier used for rendering and onDismissed callbacks. */
196
+ /**
197
+ * A unique identifier used for rendering and onDismissed callbacks.
198
+ */
144
199
  id: number | string;
145
200
  };
146
201
 
147
202
  declare interface FlagPropsWithoutId
148
203
  extends AutoDismissFlagPropsWithoutId,
149
204
  WithAnalyticsEventsProps {
150
- /** Standard onBlur event, applied to Flag by AutoDismissFlag */
205
+ /**
206
+ * Standard onBlur event, applied to Flag by AutoDismissFlag
207
+ */
151
208
  onBlur?: (
152
209
  e: React.FocusEvent<HTMLElement>,
153
210
  analyticsEvent: UIAnalyticsEvent,
154
211
  ) => void;
155
- /** Standard onFocus event, applied to Flag by AutoDismissFlag */
212
+ /**
213
+ * Standard onFocus event, applied to Flag by AutoDismissFlag
214
+ */
156
215
  onFocus?: (
157
216
  e: React.FocusEvent<HTMLElement>,
158
217
  analyticsEvent: UIAnalyticsEvent,
159
218
  ) => void;
160
- /** Standard onMouseOut event, applied to Flag by AutoDismissFlag */
219
+ /**
220
+ * Standard onMouseOut event, applied to Flag by AutoDismissFlag
221
+ */
161
222
  onMouseOut?: MouseEventHandler;
162
- /** Standard onMouseOver event, applied to Flag by AutoDismissFlag */
223
+ /**
224
+ * Standard onMouseOver event, applied to Flag by AutoDismissFlag
225
+ */
163
226
  onMouseOver?: MouseEventHandler;
164
227
  }
165
228
 
@@ -169,6 +232,10 @@ export declare function FlagsProvider({
169
232
  children: React_2.ReactNode;
170
233
  }): JSX.Element;
171
234
 
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
+ */
172
239
  export declare function useFlags(): FlagAPI;
173
240
 
174
241
  export declare const withFlagsProvider: (