@atlaskit/flag 14.6.0 → 14.6.1

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,12 @@
1
1
  # @atlaskit/flag
2
2
 
3
+ ## 14.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`45ebe7af434`](https://bitbucket.org/atlassian/atlassian-frontend/commits/45ebe7af434) - Moved to using declarative entrypoints internally. Public API is unchanged.
8
+ - Updated dependencies
9
+
3
10
  ## 14.6.0
4
11
 
5
12
  ### Minor 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.6.0";
29
+ var packageVersion = "14.6.1";
30
30
  var AUTO_DISMISS_SECONDS = 8;
31
31
  exports.AUTO_DISMISS_SECONDS = AUTO_DISMISS_SECONDS;
32
32
 
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.6.0"
47
+ packageVersion: "14.6.1"
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.6.0",
3
+ "version": "14.6.1",
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.6.0";
8
+ const packageVersion = "14.6.1";
9
9
  export const AUTO_DISMISS_SECONDS = 8;
10
10
 
11
11
  const AutoDismissFlag = props => {
@@ -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.6.0"
19
+ packageVersion: "14.6.1"
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.6.0",
3
+ "version": "14.6.1",
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.6.0";
8
+ var packageVersion = "14.6.1";
9
9
  export var AUTO_DISMISS_SECONDS = 8;
10
10
 
11
11
  var AutoDismissFlag = function AutoDismissFlag(props) {
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.6.0"
25
+ packageVersion: "14.6.1"
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.6.0",
3
+ "version": "14.6.1",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "14.6.0",
3
+ "version": "14.6.1",
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/"
@@ -16,20 +16,30 @@
16
16
  "atlaskit:src": "src/index.ts",
17
17
  "atlassian": {
18
18
  "team": "Design System Team",
19
- "deprecatedAutoEntryPoints": true,
20
19
  "releaseModel": "scheduled",
21
20
  "website": {
22
21
  "name": "Flag",
23
22
  "category": "Components"
24
23
  }
25
24
  },
25
+ "af:exports": {
26
+ ".": "./src/index.ts",
27
+ "./auto-dismiss-flag": "./src/auto-dismiss-flag.tsx",
28
+ "./constants": "./src/constants.ts",
29
+ "./flag-actions": "./src/flag-actions.tsx",
30
+ "./flag-group": "./src/flag-group.tsx",
31
+ "./flag-provider": "./src/flag-provider.tsx",
32
+ "./flag": "./src/flag.tsx",
33
+ "./theme": "./src/theme.ts",
34
+ "./types": "./src/types.ts"
35
+ },
26
36
  "dependencies": {
27
37
  "@atlaskit/analytics-next": "^8.0.0",
28
38
  "@atlaskit/button": "^16.3.0",
29
39
  "@atlaskit/ds-lib": "^2.0.0",
30
40
  "@atlaskit/focus-ring": "^1.0.0",
31
41
  "@atlaskit/icon": "^21.10.0",
32
- "@atlaskit/motion": "^1.1.0",
42
+ "@atlaskit/motion": "^1.2.0",
33
43
  "@atlaskit/portal": "^4.0.0",
34
44
  "@atlaskit/theme": "^12.1.0",
35
45
  "@atlaskit/tokens": "^0.10.0",
package/report.api.md ADDED
@@ -0,0 +1,179 @@
1
+ ## API Report File for "@atlaskit/flag"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+ /// <reference types="react" />
7
+
8
+ import { ComponentType } from 'react';
9
+ import { CustomThemeButtonProps } from '@atlaskit/button/types';
10
+ import { MouseEventHandler } from 'react';
11
+ import { default as React_2 } from 'react';
12
+ import { ReactElement } from 'react';
13
+ import { ReactNode } from 'react';
14
+ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
15
+ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
16
+
17
+ export declare type ActionsType = Array<ActionType>;
18
+
19
+ declare type ActionType = {
20
+ content: ReactNode;
21
+ onClick?: (
22
+ e: React.MouseEvent<HTMLElement>,
23
+ analyticsEvent: UIAnalyticsEvent,
24
+ ) => void;
25
+ href?: string;
26
+ target?: string;
27
+ testId?: string;
28
+ };
29
+
30
+ export declare type AppearanceTypes =
31
+ | 'error'
32
+ | 'info'
33
+ | 'normal'
34
+ | 'success'
35
+ | 'warning';
36
+
37
+ export declare const AutoDismissFlag: (
38
+ props: AutoDismissFlagProps,
39
+ ) => JSX.Element;
40
+
41
+ declare interface AutoDismissFlagProps
42
+ extends AutoDismissFlagPropsWithoutId,
43
+ FlagPropsId {}
44
+
45
+ declare type AutoDismissFlagPropsWithoutId = {
46
+ /** Array of clickable actions to be shown at the bottom of the flag. For flags where appearance
47
+ * is 'normal', actions will be shown as links. For all other appearance values, actions will
48
+ * shown as buttons.
49
+ * If href is passed the action will be shown as a link with the passed href prop.
50
+ */
51
+ actions?: ActionsType;
52
+ /** Makes the flag appearance bold. Setting this to anything other than 'normal' hides the
53
+ * dismiss button.
54
+ */
55
+ appearance?: AppearanceTypes;
56
+ /** The secondary content shown below the flag title */
57
+ description?: ReactNode;
58
+ /** The icon displayed in the top-left of the flag. Should be an instance of `@atlaskit/icon`.
59
+ * Your icon will receive the appropriate default color, which you can override by wrapping the
60
+ * icon in a containing element with CSS `color` set to your preferred icon color.
61
+ */
62
+ icon: ReactNode;
63
+ /** The bold text shown at the top of the flag. */
64
+ title: ReactNode;
65
+ /** Handler which will be called when a Flag's dismiss button is clicked.
66
+ * Receives the id of the dismissed Flag as a parameter.
67
+ */
68
+ 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. */
73
+ linkComponent?: ComponentType<CustomThemeButtonProps>;
74
+ /**
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
+ */
88
+ testId?: string;
89
+ /** Additional information to be included in the `context` of analytics events that come from flag */
90
+ analyticsContext?: Record<string, any>;
91
+ };
92
+
93
+ declare type Combine<First, Second> = Omit<First, keyof Second> & Second;
94
+
95
+ export declare interface CreateFlagArgs extends FlagPropsWithoutId {
96
+ /** A unique identifier used for rendering and onDismissed callbacks.
97
+ * This will be autogenerated if you don’t supply one.
98
+ * If you don’t want the same flag showing multiple times, provide a unique id.
99
+ */
100
+ id?: FlagId;
101
+ /** Marks whether the flag should render as an AutoDismissFlag */
102
+ isAutoDismiss?: boolean;
103
+ }
104
+
105
+ export declare type DismissFn = () => void;
106
+
107
+ declare const Flag: (props: FlagProps) => JSX.Element;
108
+ export default Flag;
109
+
110
+ export declare type FlagAPI = {
111
+ showFlag: (args: CreateFlagArgs) => DismissFn;
112
+ };
113
+
114
+ export declare type FlagArgs = Combine<
115
+ CreateFlagArgs,
116
+ {
117
+ id: FlagId;
118
+ }
119
+ >;
120
+
121
+ export declare const FlagGroup: (props: FlagGroupProps) => JSX.Element;
122
+
123
+ declare type FlagGroupProps = {
124
+ /** ID attribute used for DOM selection. */
125
+ id?: string;
126
+ /** Describes the specific role of this FlagGroup for users viewing the page with a screen reader (defaults to `Flag notifications`). */
127
+ label?: string;
128
+ /** Describes the specific tag on which the screen reader text will be rendered (defaults to `h2`). */
129
+ labelTag?: React.ElementType;
130
+ /** Flag elements to be displayed. */
131
+ children?: Array<ReactElement> | ReactElement | null | boolean;
132
+ /** Handler which will be called when a Flag's dismiss button is clicked.
133
+ * Receives the id of the dismissed Flag as a parameter.
134
+ */
135
+ onDismissed?: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
136
+ };
137
+
138
+ declare type FlagId = string | number;
139
+
140
+ export declare interface FlagProps extends FlagPropsWithoutId, FlagPropsId {}
141
+
142
+ declare type FlagPropsId = {
143
+ /** A unique identifier used for rendering and onDismissed callbacks. */
144
+ id: number | string;
145
+ };
146
+
147
+ declare interface FlagPropsWithoutId
148
+ extends AutoDismissFlagPropsWithoutId,
149
+ WithAnalyticsEventsProps {
150
+ /** Standard onBlur event, applied to Flag by AutoDismissFlag */
151
+ onBlur?: (
152
+ e: React.FocusEvent<HTMLElement>,
153
+ analyticsEvent: UIAnalyticsEvent,
154
+ ) => void;
155
+ /** Standard onFocus event, applied to Flag by AutoDismissFlag */
156
+ onFocus?: (
157
+ e: React.FocusEvent<HTMLElement>,
158
+ analyticsEvent: UIAnalyticsEvent,
159
+ ) => void;
160
+ /** Standard onMouseOut event, applied to Flag by AutoDismissFlag */
161
+ onMouseOut?: MouseEventHandler;
162
+ /** Standard onMouseOver event, applied to Flag by AutoDismissFlag */
163
+ onMouseOver?: MouseEventHandler;
164
+ }
165
+
166
+ export declare function FlagsProvider({
167
+ children,
168
+ }: {
169
+ children: React_2.ReactNode;
170
+ }): JSX.Element;
171
+
172
+ export declare function useFlags(): FlagAPI;
173
+
174
+ export declare const withFlagsProvider: (
175
+ fn: () => React_2.ReactNode,
176
+ ) => React_2.ReactNode;
177
+
178
+ export {};
179
+ ```