@atlaskit/flag 16.2.0 → 17.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 (48) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cjs/auto-dismiss-flag.js +1 -1
  3. package/dist/cjs/constants.js +2 -6
  4. package/dist/cjs/flag-actions.compiled.css +17 -0
  5. package/dist/cjs/flag-actions.js +31 -57
  6. package/dist/cjs/flag-group.compiled.css +17 -0
  7. package/dist/cjs/flag-group.js +26 -78
  8. package/dist/cjs/flag.compiled.css +21 -0
  9. package/dist/cjs/flag.js +48 -76
  10. package/dist/cjs/internal/dismiss-button.compiled.css +15 -0
  11. package/dist/cjs/internal/dismiss-button.js +17 -18
  12. package/dist/cjs/internal/expander.compiled.css +2 -0
  13. package/dist/cjs/internal/expander.js +19 -15
  14. package/dist/es2019/auto-dismiss-flag.js +1 -1
  15. package/dist/es2019/constants.js +1 -5
  16. package/dist/es2019/flag-actions.compiled.css +17 -0
  17. package/dist/es2019/flag-actions.js +18 -57
  18. package/dist/es2019/flag-group.compiled.css +17 -0
  19. package/dist/es2019/flag-group.js +24 -78
  20. package/dist/es2019/flag.compiled.css +21 -0
  21. package/dist/es2019/flag.js +40 -75
  22. package/dist/es2019/internal/dismiss-button.compiled.css +15 -0
  23. package/dist/es2019/internal/dismiss-button.js +16 -17
  24. package/dist/es2019/internal/expander.compiled.css +2 -0
  25. package/dist/es2019/internal/expander.js +11 -10
  26. package/dist/esm/auto-dismiss-flag.js +1 -1
  27. package/dist/esm/constants.js +1 -5
  28. package/dist/esm/flag-actions.compiled.css +17 -0
  29. package/dist/esm/flag-actions.js +29 -55
  30. package/dist/esm/flag-group.compiled.css +17 -0
  31. package/dist/esm/flag-group.js +24 -78
  32. package/dist/esm/flag.compiled.css +21 -0
  33. package/dist/esm/flag.js +43 -77
  34. package/dist/esm/internal/dismiss-button.compiled.css +15 -0
  35. package/dist/esm/internal/dismiss-button.js +16 -17
  36. package/dist/esm/internal/expander.compiled.css +2 -0
  37. package/dist/esm/internal/expander.js +11 -10
  38. package/dist/types/constants.d.ts +0 -4
  39. package/dist/types/flag-group.d.ts +2 -3
  40. package/dist/types/internal/dismiss-button.d.ts +2 -2
  41. package/dist/types/internal/expander.d.ts +2 -2
  42. package/dist/types/theme.d.ts +1 -1
  43. package/dist/types-ts4.5/constants.d.ts +0 -4
  44. package/dist/types-ts4.5/flag-group.d.ts +2 -3
  45. package/dist/types-ts4.5/internal/dismiss-button.d.ts +2 -2
  46. package/dist/types-ts4.5/internal/expander.d.ts +2 -2
  47. package/dist/types-ts4.5/theme.d.ts +1 -1
  48. package/package.json +16 -15
@@ -1,22 +1,16 @@
1
- import React, { memo } from 'react';
1
+ /* dismiss-button.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./dismiss-button.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import { memo } from 'react';
2
6
  import CloseIcon from '@atlaskit/icon/core/migration/close--cross';
3
7
  import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down--hipchat-chevron-down';
4
8
  import ChevronUpIcon from '@atlaskit/icon/utility/migration/chevron-up--hipchat-chevron-up';
5
- import { Pressable, xcss } from '@atlaskit/primitives';
9
+ import { Pressable } from '@atlaskit/primitives/compiled';
6
10
  import { flagTextColorToken } from '../theme';
7
- var buttonStyles = xcss({
8
- display: 'flex',
9
- width: '24px',
10
- height: '24px',
11
- padding: 'space.0',
12
- alignItems: 'center',
13
- justifyContent: 'center',
14
- flex: '0 0 auto',
15
- background: 'none',
16
- borderStyle: 'none',
17
- cursor: 'pointer',
18
- whiteSpace: 'nowrap'
19
- });
11
+ var styles = {
12
+ button: "_16jlidpf _1o9zidpf _i0dl1wug _1dqoglyw _1e0c1txw _1bsb1tcg _4t3i1tcg _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _4cvr1h6o _1bah1h6o _80omtlke _o5721q9c"
13
+ };
20
14
  var DismissButtonComponent = function DismissButtonComponent(_ref) {
21
15
  var appearance = _ref.appearance,
22
16
  onClick = _ref.onClick,
@@ -34,8 +28,13 @@ var DismissButtonComponent = function DismissButtonComponent(_ref) {
34
28
  buttonTestId = testId && "".concat(testId, "-toggle");
35
29
  }
36
30
  return /*#__PURE__*/React.createElement(Pressable, {
37
- xcss: buttonStyles,
38
- onClick: onClick,
31
+ xcss: styles.button,
32
+ onClick: onClick
33
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
34
+ ,
35
+ style: {
36
+ background: 'none'
37
+ },
39
38
  "aria-expanded": isBold ? isExpanded : undefined,
40
39
  testId: buttonTestId,
41
40
  "aria-label": buttonLabel
@@ -0,0 +1,2 @@
1
+
2
+ ._v5641xzp{transition:max-height .3s}._1bsb1osq{width:100%}
@@ -1,13 +1,14 @@
1
+ /* expander.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import { xcss, Stack, Box } from '@atlaskit/primitives';
3
+ import "./expander.compiled.css";
4
+ import * as React from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
4
6
  import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
5
- var expanderStyles = xcss({
6
- width: '100%'
7
- });
8
- var containerStyles = xcss({
9
- transition: "max-height 0.3s"
10
- });
7
+ import { Box, Stack } from '@atlaskit/primitives/compiled';
8
+ var styles = {
9
+ expander: "_1bsb1osq",
10
+ container: "_v5641xzp"
11
+ };
11
12
  var Expander = function Expander(_ref) {
12
13
  var children = _ref.children,
13
14
  isExpanded = _ref.isExpanded,
@@ -17,7 +18,7 @@ var Expander = function Expander(_ref) {
17
18
  // the the reveal because we don't know the height of the content.
18
19
 
19
20
  return /*#__PURE__*/React.createElement(Box, {
20
- xcss: containerStyles,
21
+ xcss: styles.expander,
21
22
  style: {
22
23
  maxHeight: isExpanded ? 150 : 0,
23
24
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
@@ -31,7 +32,7 @@ var Expander = function Expander(_ref) {
31
32
  appear: true
32
33
  }, isExpanded && /*#__PURE__*/React.createElement(FadeIn, null, function (props) {
33
34
  return /*#__PURE__*/React.createElement(Box, _extends({
34
- xcss: expanderStyles
35
+ xcss: styles.container
35
36
  }, props), /*#__PURE__*/React.createElement(Stack, {
36
37
  space: "space.100"
37
38
  }, children));
@@ -1,6 +1,2 @@
1
1
  import { type AppearanceTypes } from './types';
2
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";
@@ -3,7 +3,6 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import { type ReactElement } from 'react';
6
- import { jsx } from '@emotion/react';
7
6
  import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
8
7
  type FlagGroupProps = {
9
8
  /**
@@ -34,7 +33,7 @@ type FlagGroupProps = {
34
33
  */
35
34
  shouldRenderToParent?: boolean;
36
35
  };
37
- export declare const flagWidth: number;
36
+ export declare const flagWidth = 400;
38
37
  type FlagGroupAPI = {
39
38
  onDismissed: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
40
39
  isDismissAllowed: boolean;
@@ -49,5 +48,5 @@ export declare function useFlagGroup(): FlagGroupAPI;
49
48
  * - [Examples](https://atlassian.design/components/flag/flag-group/examples)
50
49
  * - [Code](https://atlassian.design/components/flag/flag-group/code)
51
50
  */
52
- declare const FlagGroup: (props: FlagGroupProps) => jsx.JSX.Element;
51
+ declare const FlagGroup: (props: FlagGroupProps) => JSX.Element;
53
52
  export default FlagGroup;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { type AppearanceTypes } from '../types';
3
3
  interface DismissButtonProps {
4
4
  appearance: AppearanceTypes;
@@ -7,5 +7,5 @@ interface DismissButtonProps {
7
7
  isBold: boolean;
8
8
  testId?: string;
9
9
  }
10
- declare const DismissButton: React.MemoExoticComponent<({ appearance, onClick, isBold, isExpanded, testId, }: DismissButtonProps) => React.JSX.Element>;
10
+ declare const DismissButton: import("react").MemoExoticComponent<({ appearance, onClick, isBold, isExpanded, testId, }: DismissButtonProps) => JSX.Element>;
11
11
  export default DismissButton;
@@ -1,8 +1,8 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  type ExpanderProps = {
3
3
  isExpanded: boolean;
4
4
  testId?: string;
5
5
  children: React.ReactNode;
6
6
  };
7
- declare const Expander: ({ children, isExpanded, testId }: ExpanderProps) => React.JSX.Element;
7
+ declare const Expander: ({ children, isExpanded, testId }: ExpanderProps) => JSX.Element;
8
8
  export default Expander;
@@ -1,5 +1,5 @@
1
1
  import { type ReactElement } from 'react';
2
- import { type BackgroundColor } from '@atlaskit/primitives';
2
+ import { type BackgroundColor } from '@atlaskit/primitives/compiled';
3
3
  import { type AppearanceTypes, type HeadingColor } from './types';
4
4
  export declare const flagBackgroundColor: Record<AppearanceTypes, BackgroundColor>;
5
5
  export declare const flagIconColor: Record<AppearanceTypes, string>;
@@ -1,6 +1,2 @@
1
1
  import { type AppearanceTypes } from './types';
2
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";
@@ -3,7 +3,6 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import { type ReactElement } from 'react';
6
- import { jsx } from '@emotion/react';
7
6
  import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
8
7
  type FlagGroupProps = {
9
8
  /**
@@ -34,7 +33,7 @@ type FlagGroupProps = {
34
33
  */
35
34
  shouldRenderToParent?: boolean;
36
35
  };
37
- export declare const flagWidth: number;
36
+ export declare const flagWidth = 400;
38
37
  type FlagGroupAPI = {
39
38
  onDismissed: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
40
39
  isDismissAllowed: boolean;
@@ -49,5 +48,5 @@ export declare function useFlagGroup(): FlagGroupAPI;
49
48
  * - [Examples](https://atlassian.design/components/flag/flag-group/examples)
50
49
  * - [Code](https://atlassian.design/components/flag/flag-group/code)
51
50
  */
52
- declare const FlagGroup: (props: FlagGroupProps) => jsx.JSX.Element;
51
+ declare const FlagGroup: (props: FlagGroupProps) => JSX.Element;
53
52
  export default FlagGroup;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { type AppearanceTypes } from '../types';
3
3
  interface DismissButtonProps {
4
4
  appearance: AppearanceTypes;
@@ -7,5 +7,5 @@ interface DismissButtonProps {
7
7
  isBold: boolean;
8
8
  testId?: string;
9
9
  }
10
- declare const DismissButton: React.MemoExoticComponent<({ appearance, onClick, isBold, isExpanded, testId, }: DismissButtonProps) => React.JSX.Element>;
10
+ declare const DismissButton: import("react").MemoExoticComponent<({ appearance, onClick, isBold, isExpanded, testId, }: DismissButtonProps) => JSX.Element>;
11
11
  export default DismissButton;
@@ -1,8 +1,8 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  type ExpanderProps = {
3
3
  isExpanded: boolean;
4
4
  testId?: string;
5
5
  children: React.ReactNode;
6
6
  };
7
- declare const Expander: ({ children, isExpanded, testId }: ExpanderProps) => React.JSX.Element;
7
+ declare const Expander: ({ children, isExpanded, testId }: ExpanderProps) => JSX.Element;
8
8
  export default Expander;
@@ -1,5 +1,5 @@
1
1
  import { type ReactElement } from 'react';
2
- import { type BackgroundColor } from '@atlaskit/primitives';
2
+ import { type BackgroundColor } from '@atlaskit/primitives/compiled';
3
3
  import { type AppearanceTypes, type HeadingColor } from './types';
4
4
  export declare const flagBackgroundColor: Record<AppearanceTypes, BackgroundColor>;
5
5
  export declare const flagIconColor: Record<AppearanceTypes, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "16.2.0",
3
+ "version": "17.0.0",
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/"
@@ -46,35 +46,36 @@
46
46
  "dependencies": {
47
47
  "@atlaskit/analytics-next": "^11.0.0",
48
48
  "@atlaskit/button": "^21.1.0",
49
+ "@atlaskit/css": "^0.10.0",
49
50
  "@atlaskit/ds-lib": "^4.0.0",
50
51
  "@atlaskit/heading": "^5.1.0",
51
- "@atlaskit/icon": "^24.1.0",
52
- "@atlaskit/motion": "^5.0.0",
53
- "@atlaskit/platform-feature-flags": "1.1.0",
54
- "@atlaskit/portal": "^5.0.0",
52
+ "@atlaskit/icon": "^25.0.0",
53
+ "@atlaskit/motion": "^5.1.0",
54
+ "@atlaskit/platform-feature-flags": "^1.1.0",
55
+ "@atlaskit/portal": "^5.1.0",
55
56
  "@atlaskit/primitives": "^14.1.0",
56
57
  "@atlaskit/theme": "^18.0.0",
57
- "@atlaskit/tokens": "^4.3.0",
58
+ "@atlaskit/tokens": "^4.5.0",
58
59
  "@atlaskit/visually-hidden": "^3.0.0",
59
60
  "@babel/runtime": "^7.0.0",
60
- "@emotion/react": "^11.7.1"
61
+ "@compiled/react": "^0.18.2"
61
62
  },
62
63
  "peerDependencies": {
63
64
  "react": "^18.2.0"
64
65
  },
65
66
  "devDependencies": {
66
- "@af/accessibility-testing": "*",
67
- "@af/integration-testing": "*",
68
- "@af/visual-regression": "*",
69
- "@atlaskit/docs": "*",
67
+ "@af/accessibility-testing": "^2.0.0",
68
+ "@af/integration-testing": "^0.5.0",
69
+ "@af/visual-regression": "^1.3.0",
70
+ "@atlaskit/docs": "^10.0.0",
70
71
  "@atlaskit/drawer": "^10.0.0",
71
72
  "@atlaskit/link": "^3.0.0",
72
73
  "@atlaskit/radio": "^8.0.0",
73
- "@atlaskit/section-message": "*",
74
+ "@atlaskit/section-message": "^8.1.0",
74
75
  "@atlaskit/spinner": "^18.0.0",
75
- "@atlaskit/ssr": "*",
76
- "@atlaskit/visual-regression": "*",
77
- "@atlassian/feature-flags-test-utils": "*",
76
+ "@atlaskit/ssr": "^0.4.0",
77
+ "@atlaskit/visual-regression": "^0.10.0",
78
+ "@atlassian/feature-flags-test-utils": "^0.3.0",
78
79
  "@emotion/jest": "^11.8.0",
79
80
  "@testing-library/react": "^13.4.0",
80
81
  "react-dom": "^18.2.0",