@atlaskit/flag 15.2.0 → 15.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/auto-dismiss-flag/package.json +2 -2
  3. package/constants/package.json +2 -2
  4. package/dist/cjs/auto-dismiss-flag.js +1 -1
  5. package/dist/cjs/flag.js +1 -1
  6. package/dist/cjs/version.json +1 -1
  7. package/dist/es2019/auto-dismiss-flag.js +1 -1
  8. package/dist/es2019/flag.js +1 -1
  9. package/dist/es2019/version.json +1 -1
  10. package/dist/esm/auto-dismiss-flag.js +1 -1
  11. package/dist/esm/flag.js +1 -1
  12. package/dist/esm/version.json +1 -1
  13. package/dist/types/flag-actions.d.ts +1 -1
  14. package/dist/types/flag-group.d.ts +2 -2
  15. package/dist/types/flag-provider.d.ts +5 -5
  16. package/dist/types/internal/expander.d.ts +1 -1
  17. package/dist/types/theme.d.ts +1 -1
  18. package/dist/types/types.d.ts +5 -5
  19. package/dist/types-ts4.5/auto-dismiss-flag.d.ts +13 -0
  20. package/dist/types-ts4.5/constants.d.ts +6 -0
  21. package/dist/types-ts4.5/flag-actions.d.ts +12 -0
  22. package/dist/types-ts4.5/flag-group.d.ts +45 -0
  23. package/dist/types-ts4.5/flag-provider.d.ts +33 -0
  24. package/dist/types-ts4.5/flag.d.ts +15 -0
  25. package/dist/types-ts4.5/index.d.ts +6 -0
  26. package/dist/types-ts4.5/internal/dismiss-button.d.ts +12 -0
  27. package/dist/types-ts4.5/internal/expander.d.ts +8 -0
  28. package/dist/types-ts4.5/internal/index.d.ts +2 -0
  29. package/dist/types-ts4.5/theme.d.ts +24 -0
  30. package/dist/types-ts4.5/types.d.ts +101 -0
  31. package/flag/package.json +2 -2
  32. package/flag-actions/package.json +2 -2
  33. package/flag-group/package.json +2 -2
  34. package/flag-provider/package.json +2 -2
  35. package/package.json +11 -3
  36. package/theme/package.json +2 -2
  37. package/types/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/flag
2
2
 
3
+ ## 15.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
+ ## 15.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
  ## 15.2.0
4
16
 
5
17
  ### Minor Changes
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/auto-dismiss-flag.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/auto-dismiss-flag.d.ts"
11
+ "../dist/types-ts4.5/auto-dismiss-flag.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -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
  }
@@ -15,7 +15,7 @@ var _flagGroup = require("./flag-group");
15
15
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
16
  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; }
17
17
  var packageName = "@atlaskit/flag";
18
- var packageVersion = "15.2.0";
18
+ var packageVersion = "15.2.2";
19
19
  var AUTO_DISMISS_SECONDS = 8;
20
20
 
21
21
  /**
package/dist/cjs/flag.js CHANGED
@@ -26,7 +26,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
26
26
  var analyticsAttributes = {
27
27
  componentName: 'flag',
28
28
  packageName: "@atlaskit/flag",
29
- packageVersion: "15.2.0"
29
+ packageVersion: "15.2.2"
30
30
  };
31
31
  var transitionStyles = (0, _react2.css)({
32
32
  flexGrow: 1,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "15.2.0",
3
+ "version": "15.2.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 = "15.2.0";
8
+ const packageVersion = "15.2.2";
9
9
  export const AUTO_DISMISS_SECONDS = 8;
10
10
 
11
11
  /**
@@ -16,7 +16,7 @@ import { Expander, DismissButton } from './internal';
16
16
  const analyticsAttributes = {
17
17
  componentName: 'flag',
18
18
  packageName: "@atlaskit/flag",
19
- packageVersion: "15.2.0"
19
+ packageVersion: "15.2.2"
20
20
  };
21
21
  const transitionStyles = css({
22
22
  flexGrow: 1,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "15.2.0",
3
+ "version": "15.2.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 = "15.2.0";
8
+ var packageVersion = "15.2.2";
9
9
  export var AUTO_DISMISS_SECONDS = 8;
10
10
 
11
11
  /**
package/dist/esm/flag.js CHANGED
@@ -20,7 +20,7 @@ import { Expander, DismissButton } from './internal';
20
20
  var analyticsAttributes = {
21
21
  componentName: 'flag',
22
22
  packageName: "@atlaskit/flag",
23
- packageVersion: "15.2.0"
23
+ packageVersion: "15.2.2"
24
24
  };
25
25
  var transitionStyles = css({
26
26
  flexGrow: 1,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "15.2.0",
3
+ "version": "15.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -2,7 +2,7 @@
2
2
  import { ComponentType, FC } from 'react';
3
3
  import type { CustomThemeButtonProps } from '@atlaskit/button/types';
4
4
  import type { ActionsType, AppearanceTypes } from './types';
5
- declare type FlagActionsProps = {
5
+ type FlagActionsProps = {
6
6
  appearance: AppearanceTypes;
7
7
  actions: ActionsType;
8
8
  linkComponent?: ComponentType<CustomThemeButtonProps>;
@@ -2,7 +2,7 @@
2
2
  import { ReactElement } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
5
- declare type FlagGroupProps = {
5
+ type FlagGroupProps = {
6
6
  /**
7
7
  * ID attribute used for DOM selection.
8
8
  */
@@ -27,7 +27,7 @@ declare type FlagGroupProps = {
27
27
  };
28
28
  export declare const flagWidth: number;
29
29
  export declare const flagAnimationTime = 400;
30
- declare type FlagGroupAPI = {
30
+ type FlagGroupAPI = {
31
31
  onDismissed: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
32
32
  isDismissAllowed: boolean;
33
33
  };
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { FlagPropsWithoutId } from './types';
3
- declare type FlagId = string | number;
4
- export declare type Combine<First, Second> = Omit<First, keyof Second> & Second;
3
+ type FlagId = string | number;
4
+ export type Combine<First, Second> = Omit<First, keyof Second> & Second;
5
5
  export interface CreateFlagArgs extends FlagPropsWithoutId {
6
6
  /**
7
7
  * A unique identifier used for rendering and onDismissed callbacks.
@@ -14,11 +14,11 @@ export interface CreateFlagArgs extends FlagPropsWithoutId {
14
14
  */
15
15
  isAutoDismiss?: boolean;
16
16
  }
17
- export declare type FlagArgs = Combine<CreateFlagArgs, {
17
+ export type FlagArgs = Combine<CreateFlagArgs, {
18
18
  id: FlagId;
19
19
  }>;
20
- export declare type DismissFn = () => void;
21
- export declare type FlagAPI = {
20
+ export type DismissFn = () => void;
21
+ export type FlagAPI = {
22
22
  showFlag: (args: CreateFlagArgs) => DismissFn;
23
23
  };
24
24
  /**
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare type ExpanderProps = {
2
+ type ExpanderProps = {
3
3
  isExpanded: boolean;
4
4
  testId?: string;
5
5
  children: React.ReactNode;
@@ -10,7 +10,7 @@ export declare const flagTextColorToken: {
10
10
  success: "var(--ds-text-inverse)";
11
11
  warning: "var(--ds-text-warning-inverse)";
12
12
  };
13
- declare type ActionBackgroundColor = Record<Exclude<AppearanceTypes, 'normal'>, {
13
+ type ActionBackgroundColor = Record<Exclude<AppearanceTypes, 'normal'>, {
14
14
  default: 'var(--ds-background-inverse-subtle)';
15
15
  active: 'var(--ds-background-inverse-subtle-pressed)';
16
16
  pressed: 'var(--ds-background-inverse-subtle-hovered)';
@@ -1,23 +1,23 @@
1
1
  import { ComponentType, MouseEventHandler, ReactNode } from 'react';
2
2
  import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
3
  import { CustomThemeButtonProps } from '@atlaskit/button/types';
4
- export declare type ActionType = {
4
+ export type ActionType = {
5
5
  content: ReactNode;
6
6
  onClick?: (e: React.MouseEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
7
7
  href?: string;
8
8
  target?: string;
9
9
  testId?: string;
10
10
  };
11
- export declare type ActionsType = Array<ActionType>;
12
- export declare type AppearanceTypes = 'error' | 'info' | 'success' | 'warning' | 'normal';
11
+ export type ActionsType = Array<ActionType>;
12
+ export type AppearanceTypes = 'error' | 'info' | 'success' | 'warning' | 'normal';
13
13
  export declare const AppearanceArray: AppearanceTypes[];
14
- declare type FlagPropsId = {
14
+ type FlagPropsId = {
15
15
  /**
16
16
  * A unique identifier used for rendering and onDismissed callbacks.
17
17
  */
18
18
  id: number | string;
19
19
  };
20
- declare type AutoDismissFlagPropsWithoutId = {
20
+ type AutoDismissFlagPropsWithoutId = {
21
21
  /**
22
22
  * Array of clickable actions to be shown at the bottom of the flag. For flags where appearance
23
23
  * is 'normal', actions will be shown as links. For all other appearance values, actions will
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,6 @@
1
+ import { AppearanceTypes } from './types';
2
+ export declare const DEFAULT_APPEARANCE: AppearanceTypes;
3
+ export declare const VAR_COLOR = "--color";
4
+ export declare const VAR_BG_COLOR = "--bg-color";
5
+ export declare const VAR_BG_COLOR_HOVER = "--bg-color-hover";
6
+ export declare const VAR_BG_COLOR_ACTIVE = "--bg-color-active";
@@ -0,0 +1,12 @@
1
+ /** @jsx jsx */
2
+ import { ComponentType, FC } from 'react';
3
+ import type { CustomThemeButtonProps } from '@atlaskit/button/types';
4
+ import type { ActionsType, AppearanceTypes } from './types';
5
+ type FlagActionsProps = {
6
+ appearance: AppearanceTypes;
7
+ actions: ActionsType;
8
+ linkComponent?: ComponentType<CustomThemeButtonProps>;
9
+ testId?: string;
10
+ };
11
+ declare const FlagActions: FC<FlagActionsProps>;
12
+ export default FlagActions;
@@ -0,0 +1,45 @@
1
+ /** @jsx jsx */
2
+ import { ReactElement } from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
5
+ 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
+ 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;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { FlagPropsWithoutId } from './types';
3
+ type FlagId = string | number;
4
+ export 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 type FlagArgs = Combine<CreateFlagArgs, {
18
+ id: FlagId;
19
+ }>;
20
+ export type DismissFn = () => void;
21
+ export 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 {};
@@ -0,0 +1,15 @@
1
+ /** @jsx jsx */
2
+ import { FC } from 'react';
3
+ import type { FlagProps } from './types';
4
+ /**
5
+ * __Flag__
6
+ *
7
+ * A flag is used for confirmations, alerts, and acknowledgments that require minimal user interaction,
8
+ * often displayed using a flag group.
9
+ *
10
+ * - [Examples](https://atlassian.design/components/flag/examples)
11
+ * - [Code](https://atlassian.design/components/flag/code)
12
+ * - [Usage](https://atlassian.design/components/flag/usage)
13
+ */
14
+ declare const Flag: FC<FlagProps>;
15
+ export default Flag;
@@ -0,0 +1,6 @@
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';
@@ -0,0 +1,12 @@
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;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ type ExpanderProps = {
3
+ isExpanded: boolean;
4
+ testId?: string;
5
+ children: React.ReactNode;
6
+ };
7
+ declare const Expander: React.FC<ExpanderProps>;
8
+ export default Expander;
@@ -0,0 +1,2 @@
1
+ export { default as Expander } from './expander';
2
+ export { default as DismissButton } from './dismiss-button';
@@ -0,0 +1,24 @@
1
+ import { UNSAFE_BoxProps as BoxProps, UNSAFE_TextProps as TextProps } from '@atlaskit/ds-explorations';
2
+ import { AppearanceTypes } from './types';
3
+ export declare const flagBackgroundColor: Record<AppearanceTypes, BoxProps['backgroundColor']>;
4
+ export declare const flagIconColor: Record<AppearanceTypes, string>;
5
+ export declare const flagTextColor: Record<AppearanceTypes, TextProps['color']>;
6
+ export declare const flagTextColorToken: {
7
+ error: "var(--ds-text-inverse)";
8
+ info: "var(--ds-text-inverse)";
9
+ normal: "var(--ds-text-subtle)";
10
+ success: "var(--ds-text-inverse)";
11
+ warning: "var(--ds-text-warning-inverse)";
12
+ };
13
+ type ActionBackgroundColor = Record<Exclude<AppearanceTypes, 'normal'>, {
14
+ default: 'var(--ds-background-inverse-subtle)';
15
+ active: 'var(--ds-background-inverse-subtle-pressed)';
16
+ pressed: 'var(--ds-background-inverse-subtle-hovered)';
17
+ }> & Record<Extract<AppearanceTypes, 'normal'>, {
18
+ default: 'none';
19
+ active: 'none';
20
+ pressed: 'none';
21
+ }>;
22
+ export declare const actionBackgroundColor: ActionBackgroundColor;
23
+ export declare const actionTextColor: Record<AppearanceTypes, string>;
24
+ export {};
@@ -0,0 +1,101 @@
1
+ import { ComponentType, MouseEventHandler, ReactNode } from 'react';
2
+ import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
+ import { CustomThemeButtonProps } from '@atlaskit/button/types';
4
+ export type ActionType = {
5
+ content: ReactNode;
6
+ onClick?: (e: React.MouseEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
7
+ href?: string;
8
+ target?: string;
9
+ testId?: string;
10
+ };
11
+ export type ActionsType = Array<ActionType>;
12
+ export type AppearanceTypes = 'error' | 'info' | 'success' | 'warning' | 'normal';
13
+ export declare const AppearanceArray: AppearanceTypes[];
14
+ type FlagPropsId = {
15
+ /**
16
+ * A unique identifier used for rendering and onDismissed callbacks.
17
+ */
18
+ id: number | string;
19
+ };
20
+ type AutoDismissFlagPropsWithoutId = {
21
+ /**
22
+ * Array of clickable actions to be shown at the bottom of the flag. For flags where appearance
23
+ * is 'normal', actions will be shown as links. For all other appearance values, actions will
24
+ * shown as buttons.
25
+ * If href is passed the action will be shown as a link with the passed href prop.
26
+ */
27
+ actions?: ActionsType;
28
+ /**
29
+ * Makes the flag appearance bold. Setting this to anything other than 'normal' hides the
30
+ * dismiss button.
31
+ */
32
+ appearance?: AppearanceTypes;
33
+ /**
34
+ * The secondary content shown below the flag title
35
+ */
36
+ description?: ReactNode;
37
+ /**
38
+ * The icon displayed in the top-left of the flag. Should be an instance of `@atlaskit/icon`.
39
+ * Your icon will receive the appropriate default color, which you can override by wrapping the
40
+ * icon in a containing element with CSS `color` set to your preferred icon color.
41
+ */
42
+ icon: ReactNode;
43
+ /**
44
+ * The bold text shown at the top of the flag.
45
+ */
46
+ title: ReactNode;
47
+ /**
48
+ * Handler which will be called when a Flag's dismiss button is clicked.
49
+ * Receives the id of the dismissed Flag as a parameter.
50
+ */
51
+ onDismissed?: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
52
+ /**
53
+ * A link component that is passed down to the `@atlaskit/button` used by actions,
54
+ * to allow custom routers to be used. See the
55
+ * [button with router](https://atlaskit.atlassian.com/packages/design-system/button/example/ButtonWithRouter)
56
+ * example of what this component should look like.
57
+ */
58
+ linkComponent?: ComponentType<CustomThemeButtonProps>;
59
+ /**
60
+ * A `testId` prop is provided for specified elements,
61
+ * which is a unique string that appears as a data attribute `data-testid` in the rendered code,
62
+ * serving as a hook for automated tests.
63
+ *
64
+ * Will set these elements when defined:
65
+ *
66
+ * - Flag root element - `{testId}`
67
+ * - Close button visible on default flags - `{testId}-dismiss`
68
+ * - Toggle button visible on bold flags - `{testId}-toggle`
69
+ * - Flag content which wraps the description and actions - `{testId}-expander`
70
+ * - Flag description - `{testId}-description`
71
+ * - Flag actions - `{testId}-actions`
72
+ */
73
+ testId?: string;
74
+ /**
75
+ * Additional information to be included in the `context` of analytics events that come from flag
76
+ */
77
+ analyticsContext?: Record<string, any>;
78
+ };
79
+ export interface AutoDismissFlagProps extends AutoDismissFlagPropsWithoutId, FlagPropsId {
80
+ }
81
+ export interface FlagPropsWithoutId extends AutoDismissFlagPropsWithoutId, WithAnalyticsEventsProps {
82
+ /**
83
+ * Standard onBlur event, applied to Flag by AutoDismissFlag
84
+ */
85
+ onBlur?: (e: React.FocusEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
86
+ /**
87
+ * Standard onFocus event, applied to Flag by AutoDismissFlag
88
+ */
89
+ onFocus?: (e: React.FocusEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
90
+ /**
91
+ * Standard onMouseOut event, applied to Flag by AutoDismissFlag
92
+ */
93
+ onMouseOut?: MouseEventHandler;
94
+ /**
95
+ * Standard onMouseOver event, applied to Flag by AutoDismissFlag
96
+ */
97
+ onMouseOver?: MouseEventHandler;
98
+ }
99
+ export interface FlagProps extends FlagPropsWithoutId, FlagPropsId {
100
+ }
101
+ export {};
package/flag/package.json CHANGED
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/flag.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/flag.d.ts"
11
+ "../dist/types-ts4.5/flag.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/flag-actions.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/flag-actions.d.ts"
11
+ "../dist/types-ts4.5/flag-actions.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/flag-group.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/flag-group.d.ts"
11
+ "../dist/types-ts4.5/flag-group.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/flag-provider.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/flag-provider.d.ts"
11
+ "../dist/types-ts4.5/flag-provider.d.ts"
12
12
  ]
13
13
  }
14
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "15.2.0",
3
+ "version": "15.2.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/"
@@ -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.tsx",
17
25
  "atlassian": {
@@ -44,7 +52,7 @@
44
52
  "@atlaskit/portal": "^4.3.0",
45
53
  "@atlaskit/primitives": "^0.9.0",
46
54
  "@atlaskit/theme": "^12.5.0",
47
- "@atlaskit/tokens": "^1.3.0",
55
+ "@atlaskit/tokens": "^1.4.0",
48
56
  "@atlaskit/visually-hidden": "^1.2.0",
49
57
  "@babel/runtime": "^7.0.0",
50
58
  "@emotion/react": "^11.7.1"
@@ -67,7 +75,7 @@
67
75
  "jest-emotion": "^10.0.32",
68
76
  "react-dom": "^16.8.0",
69
77
  "storybook-addon-performance": "^0.16.0",
70
- "typescript": "4.5.5"
78
+ "typescript": "~4.9.5"
71
79
  },
72
80
  "keywords": [
73
81
  "atlaskit",
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/theme.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/theme.d.ts"
11
+ "../dist/types-ts4.5/theme.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -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
  }