@atlaskit/flag 15.2.4 → 15.2.6

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,17 @@
1
1
  # @atlaskit/flag
2
2
 
3
+ ## 15.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`779727e307a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/779727e307a) - Internal change only. Replace all instances of Box with stable @atlaskit/primitives version.
8
+
9
+ ## 15.2.5
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 15.2.4
4
16
 
5
17
  ### Patch Changes
@@ -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.4";
18
+ var packageVersion = "15.2.6";
19
19
  var AUTO_DISMISS_SECONDS = 8;
20
20
 
21
21
  /**
@@ -9,7 +9,6 @@ exports.useFlagGroup = useFlagGroup;
9
9
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
10
10
  var _react = require("react");
11
11
  var _react2 = require("@emotion/react");
12
- var _dsExplorations = require("@atlaskit/ds-explorations");
13
12
  var _motion = require("@atlaskit/motion");
14
13
  var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
15
14
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
@@ -24,8 +23,6 @@ var flagWidth = gridSize * 50;
24
23
  exports.flagWidth = flagWidth;
25
24
  var flagAnimationTime = 400;
26
25
  exports.flagAnimationTime = flagAnimationTime;
27
- var flagBottom = gridSize * 6;
28
- var flagLeft = gridSize * 10;
29
26
  var defaultFlagGroupContext = {
30
27
  onDismissed: _noop.default,
31
28
  isDismissAllowed: false
@@ -44,7 +41,7 @@ function useFlagGroup() {
44
41
  // that causes a broken transition
45
42
  var baseStyles = (0, _react2.css)({
46
43
  width: flagWidth,
47
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
44
+ position: 'absolute',
48
45
  bottom: 0,
49
46
  transition: "transform ".concat(flagAnimationTime, "ms ease-in-out"),
50
47
  '@media (max-width: 560px)': {
@@ -79,15 +76,12 @@ var dismissAllowedStyles = (0, _react2.css)({
79
76
  }
80
77
  });
81
78
  var flagGroupContainerStyles = (0, _react2.css)({
82
- zIndex: _constants.layers.flag(),
83
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
84
- bottom: flagBottom,
85
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
86
- left: flagLeft,
79
+ position: 'fixed',
80
+ zIndex: 'flag',
81
+ bottom: "var(--ds-space-600, 48px)",
82
+ left: "var(--ds-space-1000, 80px)",
87
83
  '@media (max-width: 560px)': {
88
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
89
84
  bottom: 0,
90
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
91
85
  left: 0
92
86
  }
93
87
  });
@@ -129,9 +123,7 @@ var FlagGroup = function FlagGroup(props) {
129
123
  }, function (_ref) {
130
124
  var className = _ref.className,
131
125
  ref = _ref.ref;
132
- return (0, _react2.jsx)(_dsExplorations.UNSAFE_Box, {
133
- display: "block",
134
- position: "absolute",
126
+ return (0, _react2.jsx)("div", {
135
127
  css: [baseStyles, isDismissAllowed && dismissAllowedStyles],
136
128
  className: className,
137
129
  ref: ref
@@ -145,9 +137,7 @@ var FlagGroup = function FlagGroup(props) {
145
137
  };
146
138
  return (0, _react2.jsx)(_portal.default, {
147
139
  zIndex: _constants.layers.flag()
148
- }, (0, _react2.jsx)(_dsExplorations.UNSAFE_Box, {
149
- display: "block",
150
- position: "fixed",
140
+ }, (0, _react2.jsx)("div", {
151
141
  id: id,
152
142
  css: flagGroupContainerStyles
153
143
  }, hasFlags ? (0, _react2.jsx)(_visuallyHidden.default, null, (0, _react2.jsx)(LabelTag, null, label)) : null, (0, _react2.jsx)(_motion.ExitingPersistence, {
package/dist/cjs/flag.js CHANGED
@@ -11,8 +11,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
11
11
  var _react = require("react");
12
12
  var _react2 = require("@emotion/react");
13
13
  var _dsExplorations = require("@atlaskit/ds-explorations");
14
- var _inline = _interopRequireDefault(require("@atlaskit/primitives/inline"));
15
- var _stack = _interopRequireDefault(require("@atlaskit/primitives/stack"));
14
+ var _primitives = require("@atlaskit/primitives");
16
15
  var _usePlatformLeafEventHandler = require("@atlaskit/analytics-next/usePlatformLeafEventHandler");
17
16
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
18
17
  var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
@@ -23,10 +22,28 @@ var _flagGroup = require("./flag-group");
23
22
  var _internal = require("./internal");
24
23
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
25
24
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } /** @jsx jsx */
25
+ var CSS_VAR_ICON_COLOR = '--flag-icon-color';
26
+ var iconWrapperStyles = (0, _react2.css)({
27
+ display: 'flex',
28
+ alignItems: 'start',
29
+ flexShrink: 0,
30
+ color: "var(".concat(CSS_VAR_ICON_COLOR, ")")
31
+ });
32
+ var flagStyles = (0, _primitives.xcss)({
33
+ boxShadow: 'overlay',
34
+ borderRadius: 'radius.100',
35
+ overflow: 'hidden',
36
+ zIndex: 'flag',
37
+ width: '100%',
38
+ transition: 'background-color 200ms'
39
+ });
40
+ var flagWrapperStyles = (0, _react2.css)({
41
+ width: '100%'
42
+ });
26
43
  var analyticsAttributes = {
27
44
  componentName: 'flag',
28
45
  packageName: "@atlaskit/flag",
29
- packageVersion: "15.2.4"
46
+ packageVersion: "15.2.6"
30
47
  };
31
48
  var transitionStyles = (0, _react2.css)({
32
49
  flexGrow: 1,
@@ -116,41 +133,30 @@ var Flag = function Flag(props) {
116
133
  var iconColor = _theme.flagIconColor[appearance];
117
134
  var isDismissable = isBold || isDismissAllowed;
118
135
  var shouldRenderGap = !isBold && (description || actions.length) || isExpanded;
119
- return (0, _react2.jsx)(_focusRing.default, null, (0, _react2.jsx)(_dsExplorations.UNSAFE_Box, (0, _extends2.default)({
120
- display: "block",
136
+ return (0, _react2.jsx)(_focusRing.default, null, (0, _react2.jsx)("div", (0, _extends2.default)({
137
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
138
+ tabIndex: 0,
139
+ role: "alert",
140
+ css: flagWrapperStyles,
141
+ "data-testid": testId
142
+ }, autoDismissProps), (0, _react2.jsx)(_primitives.Box, {
121
143
  backgroundColor: _theme.flagBackgroundColor[appearance],
122
- shadow: "overlay",
123
144
  padding: "space.200",
124
- borderRadius: "normal",
125
- overflow: "hidden",
126
- layer: "flag",
127
- UNSAFE_style: {
128
- width: '100%',
129
- transition: 'background-color 200ms'
130
- },
131
- role: "alert",
132
- tabIndex: 0,
133
- testId: testId
134
- }, autoDismissProps), (0, _react2.jsx)(_inline.default, {
145
+ xcss: flagStyles
146
+ }, (0, _react2.jsx)(_primitives.Inline, {
135
147
  space: "space.200"
136
- }, (0, _react2.jsx)(_dsExplorations.UNSAFE_Box, {
137
- alignItems: "start",
138
- UNSAFE_style: {
139
- color: iconColor,
140
- flexShrink: 0
141
- }
148
+ }, (0, _react2.jsx)("div", {
149
+ css: iconWrapperStyles,
150
+ style: (0, _defineProperty2.default)({}, CSS_VAR_ICON_COLOR, iconColor)
142
151
  }, icon), (0, _react2.jsx)("span", {
143
152
  css: transitionStyles
144
- }, (0, _react2.jsx)(_stack.default, {
153
+ }, (0, _react2.jsx)(_primitives.Stack, {
145
154
  space: shouldRenderGap ? 'space.100' : 'space.0' // Gap exists even when not expanded due to Expander internals always being in the DOM
146
- }, (0, _react2.jsx)(_inline.default, {
155
+ }, (0, _react2.jsx)(_primitives.Inline, {
147
156
  space: "space.100",
148
157
  spread: "space-between"
149
- }, (0, _react2.jsx)(_dsExplorations.UNSAFE_Box, {
150
- display: "block",
151
- UNSAFE_style: {
152
- paddingTop: "var(--ds-space-025, 2px)"
153
- }
158
+ }, (0, _react2.jsx)(_primitives.Box, {
159
+ paddingBlockStart: "space.025"
154
160
  }, (0, _react2.jsx)(_dsExplorations.UNSAFE_Text, {
155
161
  color: textColor,
156
162
  fontWeight: "semibold",
@@ -182,7 +188,7 @@ var Flag = function Flag(props) {
182
188
  appearance: appearance,
183
189
  linkComponent: linkComponent,
184
190
  testId: testId
185
- })))))));
191
+ }))))))));
186
192
  };
187
193
  var _default = Flag;
188
194
  exports.default = _default;
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = require("react");
9
9
  var _react2 = require("@emotion/react");
10
- var _dsExplorations = require("@atlaskit/ds-explorations");
11
10
  var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
12
11
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/hipchat/chevron-down"));
13
12
  var _chevronUp = _interopRequireDefault(require("@atlaskit/icon/glyph/hipchat/chevron-up"));
@@ -15,6 +14,19 @@ var _cross = _interopRequireDefault(require("@atlaskit/icon/glyph/cross"));
15
14
  var _theme = require("../theme");
16
15
  /** @jsx jsx */
17
16
 
17
+ var buttonStyles = (0, _react2.css)({
18
+ display: 'flex',
19
+ width: '24px',
20
+ height: '24px',
21
+ padding: "var(--ds-space-0, 0px)",
22
+ alignItems: 'center',
23
+ justifyContent: 'center',
24
+ flex: '0 0 auto',
25
+ background: 'none',
26
+ borderStyle: 'none',
27
+ cursor: 'pointer',
28
+ whiteSpace: 'nowrap'
29
+ });
18
30
  var DismissButton = function DismissButton(_ref) {
19
31
  var appearance = _ref.appearance,
20
32
  onClick = _ref.onClick,
@@ -31,25 +43,12 @@ var DismissButton = function DismissButton(_ref) {
31
43
  size = 'medium';
32
44
  buttonTestId = testId && "".concat(testId, "-toggle");
33
45
  }
34
- return (0, _react2.jsx)(_focusRing.default, null, (0, _react2.jsx)(_dsExplorations.UNSAFE_Box, {
35
- as: "button",
46
+ return (0, _react2.jsx)(_focusRing.default, null, (0, _react2.jsx)("button", {
36
47
  type: "button",
37
- justifyContent: "center",
38
- alignItems: "center",
39
- borderStyle: "none",
40
- borderRadius: "normal",
41
- padding: "space.0",
42
- width: "size.200",
43
- height: "size.200",
48
+ css: buttonStyles,
44
49
  onClick: onClick,
45
50
  "aria-expanded": isBold ? isExpanded : undefined,
46
- UNSAFE_style: {
47
- flex: '0 0 auto',
48
- background: 'none',
49
- cursor: 'pointer',
50
- whiteSpace: 'nowrap'
51
- },
52
- testId: buttonTestId
51
+ "data-testid": buttonTestId
53
52
  }, (0, _react2.jsx)(ButtonIcon, {
54
53
  label: buttonLabel,
55
54
  size: size,
@@ -7,9 +7,14 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
- var _dsExplorations = require("@atlaskit/ds-explorations");
11
- var _stack = _interopRequireDefault(require("@atlaskit/primitives/stack"));
10
+ var _primitives = require("@atlaskit/primitives");
12
11
  var _motion = require("@atlaskit/motion");
12
+ var expanderStyles = (0, _primitives.xcss)({
13
+ width: '100%'
14
+ });
15
+ var containerStyles = (0, _primitives.xcss)({
16
+ transition: "max-height 0.3s"
17
+ });
13
18
  var Expander = function Expander(_ref) {
14
19
  var children = _ref.children,
15
20
  isExpanded = _ref.isExpanded,
@@ -18,24 +23,21 @@ var Expander = function Expander(_ref) {
18
23
  // reveal transition doesn't happen. We can't use CSS animation for
19
24
  // the the reveal because we don't know the height of the content.
20
25
 
21
- return /*#__PURE__*/_react.default.createElement(_dsExplorations.UNSAFE_Box, {
22
- UNSAFE_style: {
23
- minWidth: 0,
26
+ return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
27
+ xcss: containerStyles,
28
+ style: {
24
29
  maxHeight: isExpanded ? 150 : 0,
25
30
  flex: '1 1 100%',
26
- transition: "max-height 0.3s"
31
+ minWidth: 0
27
32
  },
28
33
  "aria-hidden": !isExpanded,
29
34
  testId: testId && "".concat(testId, "-expander")
30
35
  }, /*#__PURE__*/_react.default.createElement(_motion.ExitingPersistence, {
31
36
  appear: true
32
37
  }, isExpanded && /*#__PURE__*/_react.default.createElement(_motion.FadeIn, null, function (props) {
33
- return /*#__PURE__*/_react.default.createElement(_dsExplorations.UNSAFE_Box, (0, _extends2.default)({
34
- display: "block",
35
- UNSAFE_style: {
36
- width: '100%'
37
- }
38
- }, props), /*#__PURE__*/_react.default.createElement(_stack.default, {
38
+ return /*#__PURE__*/_react.default.createElement(_primitives.Box, (0, _extends2.default)({
39
+ xcss: expanderStyles
40
+ }, props), /*#__PURE__*/_react.default.createElement(_primitives.Stack, {
39
41
  space: "space.100"
40
42
  }, children));
41
43
  })));
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "15.2.4",
3
+ "version": "15.2.6",
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.4";
8
+ const packageVersion = "15.2.6";
9
9
  export const AUTO_DISMISS_SECONDS = 8;
10
10
 
11
11
  /**
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
+
2
3
  import { Children, createContext, useContext, useMemo } from 'react';
3
4
  import { css, jsx } from '@emotion/react';
4
- import { UNSAFE_Box as Box } from '@atlaskit/ds-explorations';
5
5
  import { easeIn, ExitingPersistence, SlideIn } from '@atlaskit/motion';
6
6
  import VisuallyHidden from '@atlaskit/visually-hidden';
7
7
  import noop from '@atlaskit/ds-lib/noop';
@@ -11,8 +11,6 @@ import { gridSize as getGridSize, layers } from '@atlaskit/theme/constants';
11
11
  const gridSize = getGridSize();
12
12
  export const flagWidth = gridSize * 50;
13
13
  export const flagAnimationTime = 400;
14
- const flagBottom = gridSize * 6;
15
- const flagLeft = gridSize * 10;
16
14
  const defaultFlagGroupContext = {
17
15
  onDismissed: noop,
18
16
  isDismissAllowed: false
@@ -30,7 +28,7 @@ export function useFlagGroup() {
30
28
  // that causes a broken transition
31
29
  const baseStyles = css({
32
30
  width: flagWidth,
33
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
31
+ position: 'absolute',
34
32
  bottom: 0,
35
33
  transition: `transform ${flagAnimationTime}ms ease-in-out`,
36
34
  '@media (max-width: 560px)': {
@@ -65,15 +63,12 @@ const dismissAllowedStyles = css({
65
63
  }
66
64
  });
67
65
  const flagGroupContainerStyles = css({
68
- zIndex: layers.flag(),
69
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
70
- bottom: flagBottom,
71
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
72
- left: flagLeft,
66
+ position: 'fixed',
67
+ zIndex: 'flag',
68
+ bottom: "var(--ds-space-600, 48px)",
69
+ left: "var(--ds-space-1000, 80px)",
73
70
  '@media (max-width: 560px)': {
74
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
75
71
  bottom: 0,
76
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
77
72
  left: 0
78
73
  }
79
74
  });
@@ -110,9 +105,7 @@ const FlagGroup = props => {
110
105
  }, ({
111
106
  className,
112
107
  ref
113
- }) => jsx(Box, {
114
- display: "block",
115
- position: "absolute",
108
+ }) => jsx("div", {
116
109
  css: [baseStyles, isDismissAllowed && dismissAllowedStyles],
117
110
  className: className,
118
111
  ref: ref
@@ -125,9 +118,7 @@ const FlagGroup = props => {
125
118
  };
126
119
  return jsx(Portal, {
127
120
  zIndex: layers.flag()
128
- }, jsx(Box, {
129
- display: "block",
130
- position: "fixed",
121
+ }, jsx("div", {
131
122
  id: id,
132
123
  css: flagGroupContainerStyles
133
124
  }, hasFlags ? jsx(VisuallyHidden, null, jsx(LabelTag, null, label)) : null, jsx(ExitingPersistence, {
@@ -2,9 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  /** @jsx jsx */
3
3
  import { useCallback, useEffect, useState } from 'react';
4
4
  import { jsx, css } from '@emotion/react';
5
- import { UNSAFE_Box as Box, UNSAFE_Text as Text } from '@atlaskit/ds-explorations';
6
- import Inline from '@atlaskit/primitives/inline';
7
- import Stack from '@atlaskit/primitives/stack';
5
+ import { UNSAFE_Text as Text } from '@atlaskit/ds-explorations';
6
+ import { Inline, Stack, Box, xcss } from '@atlaskit/primitives';
8
7
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
9
8
  import noop from '@atlaskit/ds-lib/noop';
10
9
  import FocusRing from '@atlaskit/focus-ring';
@@ -13,10 +12,28 @@ import { flagTextColor, flagBackgroundColor, flagIconColor } from './theme';
13
12
  import Actions from './flag-actions';
14
13
  import { useFlagGroup } from './flag-group';
15
14
  import { Expander, DismissButton } from './internal';
15
+ const CSS_VAR_ICON_COLOR = '--flag-icon-color';
16
+ const iconWrapperStyles = css({
17
+ display: 'flex',
18
+ alignItems: 'start',
19
+ flexShrink: 0,
20
+ color: `var(${CSS_VAR_ICON_COLOR})`
21
+ });
22
+ const flagStyles = xcss({
23
+ boxShadow: 'overlay',
24
+ borderRadius: 'radius.100',
25
+ overflow: 'hidden',
26
+ zIndex: 'flag',
27
+ width: '100%',
28
+ transition: 'background-color 200ms'
29
+ });
30
+ const flagWrapperStyles = css({
31
+ width: '100%'
32
+ });
16
33
  const analyticsAttributes = {
17
34
  componentName: 'flag',
18
35
  packageName: "@atlaskit/flag",
19
- packageVersion: "15.2.4"
36
+ packageVersion: "15.2.6"
20
37
  };
21
38
  const transitionStyles = css({
22
39
  flexGrow: 1,
@@ -102,28 +119,22 @@ const Flag = props => {
102
119
  const iconColor = flagIconColor[appearance];
103
120
  const isDismissable = isBold || isDismissAllowed;
104
121
  const shouldRenderGap = !isBold && (description || actions.length) || isExpanded;
105
- return jsx(FocusRing, null, jsx(Box, _extends({
106
- display: "block",
122
+ return jsx(FocusRing, null, jsx("div", _extends({
123
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
124
+ tabIndex: 0,
125
+ role: "alert",
126
+ css: flagWrapperStyles,
127
+ "data-testid": testId
128
+ }, autoDismissProps), jsx(Box, {
107
129
  backgroundColor: flagBackgroundColor[appearance],
108
- shadow: "overlay",
109
130
  padding: "space.200",
110
- borderRadius: "normal",
111
- overflow: "hidden",
112
- layer: "flag",
113
- UNSAFE_style: {
114
- width: '100%',
115
- transition: 'background-color 200ms'
116
- },
117
- role: "alert",
118
- tabIndex: 0,
119
- testId: testId
120
- }, autoDismissProps), jsx(Inline, {
131
+ xcss: flagStyles
132
+ }, jsx(Inline, {
121
133
  space: "space.200"
122
- }, jsx(Box, {
123
- alignItems: "start",
124
- UNSAFE_style: {
125
- color: iconColor,
126
- flexShrink: 0
134
+ }, jsx("div", {
135
+ css: iconWrapperStyles,
136
+ style: {
137
+ [CSS_VAR_ICON_COLOR]: iconColor
127
138
  }
128
139
  }, icon), jsx("span", {
129
140
  css: transitionStyles
@@ -133,10 +144,7 @@ const Flag = props => {
133
144
  space: "space.100",
134
145
  spread: "space-between"
135
146
  }, jsx(Box, {
136
- display: "block",
137
- UNSAFE_style: {
138
- paddingTop: "var(--ds-space-025, 2px)"
139
- }
147
+ paddingBlockStart: "space.025"
140
148
  }, jsx(Text, {
141
149
  color: textColor,
142
150
  fontWeight: "semibold",
@@ -168,6 +176,6 @@ const Flag = props => {
168
176
  appearance: appearance,
169
177
  linkComponent: linkComponent,
170
178
  testId: testId
171
- })))))));
179
+ }))))))));
172
180
  };
173
181
  export default Flag;
@@ -1,12 +1,24 @@
1
1
  /** @jsx jsx */
2
2
  import { memo } from 'react';
3
- import { jsx } from '@emotion/react';
4
- import { UNSAFE_Box as Box } from '@atlaskit/ds-explorations';
3
+ import { css, jsx } from '@emotion/react';
5
4
  import FocusRing from '@atlaskit/focus-ring';
6
5
  import ChevronDownIcon from '@atlaskit/icon/glyph/hipchat/chevron-down';
7
6
  import ChevronUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-up';
8
7
  import CrossIcon from '@atlaskit/icon/glyph/cross';
9
8
  import { flagTextColorToken } from '../theme';
9
+ const buttonStyles = css({
10
+ display: 'flex',
11
+ width: '24px',
12
+ height: '24px',
13
+ padding: "var(--ds-space-0, 0px)",
14
+ alignItems: 'center',
15
+ justifyContent: 'center',
16
+ flex: '0 0 auto',
17
+ background: 'none',
18
+ borderStyle: 'none',
19
+ cursor: 'pointer',
20
+ whiteSpace: 'nowrap'
21
+ });
10
22
  const DismissButton = ({
11
23
  appearance,
12
24
  onClick,
@@ -24,25 +36,12 @@ const DismissButton = ({
24
36
  size = 'medium';
25
37
  buttonTestId = testId && `${testId}-toggle`;
26
38
  }
27
- return jsx(FocusRing, null, jsx(Box, {
28
- as: "button",
39
+ return jsx(FocusRing, null, jsx("button", {
29
40
  type: "button",
30
- justifyContent: "center",
31
- alignItems: "center",
32
- borderStyle: "none",
33
- borderRadius: "normal",
34
- padding: "space.0",
35
- width: "size.200",
36
- height: "size.200",
41
+ css: buttonStyles,
37
42
  onClick: onClick,
38
43
  "aria-expanded": isBold ? isExpanded : undefined,
39
- UNSAFE_style: {
40
- flex: '0 0 auto',
41
- background: 'none',
42
- cursor: 'pointer',
43
- whiteSpace: 'nowrap'
44
- },
45
- testId: buttonTestId
44
+ "data-testid": buttonTestId
46
45
  }, jsx(ButtonIcon, {
47
46
  label: buttonLabel,
48
47
  size: size,
@@ -1,8 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
- import { UNSAFE_Box as Box } from '@atlaskit/ds-explorations';
4
- import Stack from '@atlaskit/primitives/stack';
3
+ import { xcss, Stack, Box } from '@atlaskit/primitives';
5
4
  import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
5
+ const expanderStyles = xcss({
6
+ width: '100%'
7
+ });
8
+ const containerStyles = xcss({
9
+ transition: `max-height 0.3s`
10
+ });
6
11
  const Expander = ({
7
12
  children,
8
13
  isExpanded,
@@ -13,21 +18,18 @@ const Expander = ({
13
18
  // the the reveal because we don't know the height of the content.
14
19
 
15
20
  return /*#__PURE__*/React.createElement(Box, {
16
- UNSAFE_style: {
17
- minWidth: 0,
21
+ xcss: containerStyles,
22
+ style: {
18
23
  maxHeight: isExpanded ? 150 : 0,
19
24
  flex: '1 1 100%',
20
- transition: `max-height 0.3s`
25
+ minWidth: 0
21
26
  },
22
27
  "aria-hidden": !isExpanded,
23
28
  testId: testId && `${testId}-expander`
24
29
  }, /*#__PURE__*/React.createElement(ExitingPersistence, {
25
30
  appear: true
26
31
  }, isExpanded && /*#__PURE__*/React.createElement(FadeIn, null, props => /*#__PURE__*/React.createElement(Box, _extends({
27
- display: "block",
28
- UNSAFE_style: {
29
- width: '100%'
30
- }
32
+ xcss: expanderStyles
31
33
  }, props), /*#__PURE__*/React.createElement(Stack, {
32
34
  space: "space.100"
33
35
  }, children)))));
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "15.2.4",
3
+ "version": "15.2.6",
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.4";
8
+ var packageVersion = "15.2.6";
9
9
  export var AUTO_DISMISS_SECONDS = 8;
10
10
 
11
11
  /**
@@ -1,8 +1,8 @@
1
1
  import _typeof from "@babel/runtime/helpers/typeof";
2
2
  /** @jsx jsx */
3
+
3
4
  import { Children, createContext, useContext, useMemo } from 'react';
4
5
  import { css, jsx } from '@emotion/react';
5
- import { UNSAFE_Box as Box } from '@atlaskit/ds-explorations';
6
6
  import { easeIn, ExitingPersistence, SlideIn } from '@atlaskit/motion';
7
7
  import VisuallyHidden from '@atlaskit/visually-hidden';
8
8
  import noop from '@atlaskit/ds-lib/noop';
@@ -12,8 +12,6 @@ import { gridSize as getGridSize, layers } from '@atlaskit/theme/constants';
12
12
  var gridSize = getGridSize();
13
13
  export var flagWidth = gridSize * 50;
14
14
  export var flagAnimationTime = 400;
15
- var flagBottom = gridSize * 6;
16
- var flagLeft = gridSize * 10;
17
15
  var defaultFlagGroupContext = {
18
16
  onDismissed: noop,
19
17
  isDismissAllowed: false
@@ -31,7 +29,7 @@ export function useFlagGroup() {
31
29
  // that causes a broken transition
32
30
  var baseStyles = css({
33
31
  width: flagWidth,
34
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
32
+ position: 'absolute',
35
33
  bottom: 0,
36
34
  transition: "transform ".concat(flagAnimationTime, "ms ease-in-out"),
37
35
  '@media (max-width: 560px)': {
@@ -66,15 +64,12 @@ var dismissAllowedStyles = css({
66
64
  }
67
65
  });
68
66
  var flagGroupContainerStyles = css({
69
- zIndex: layers.flag(),
70
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
71
- bottom: flagBottom,
72
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
73
- left: flagLeft,
67
+ position: 'fixed',
68
+ zIndex: 'flag',
69
+ bottom: "var(--ds-space-600, 48px)",
70
+ left: "var(--ds-space-1000, 80px)",
74
71
  '@media (max-width: 560px)': {
75
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
76
72
  bottom: 0,
77
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
78
73
  left: 0
79
74
  }
80
75
  });
@@ -116,9 +111,7 @@ var FlagGroup = function FlagGroup(props) {
116
111
  }, function (_ref) {
117
112
  var className = _ref.className,
118
113
  ref = _ref.ref;
119
- return jsx(Box, {
120
- display: "block",
121
- position: "absolute",
114
+ return jsx("div", {
122
115
  css: [baseStyles, isDismissAllowed && dismissAllowedStyles],
123
116
  className: className,
124
117
  ref: ref
@@ -132,9 +125,7 @@ var FlagGroup = function FlagGroup(props) {
132
125
  };
133
126
  return jsx(Portal, {
134
127
  zIndex: layers.flag()
135
- }, jsx(Box, {
136
- display: "block",
137
- position: "fixed",
128
+ }, jsx("div", {
138
129
  id: id,
139
130
  css: flagGroupContainerStyles
140
131
  }, hasFlags ? jsx(VisuallyHidden, null, jsx(LabelTag, null, label)) : null, jsx(ExitingPersistence, {
package/dist/esm/flag.js CHANGED
@@ -6,9 +6,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
6
6
  /** @jsx jsx */
7
7
  import { useCallback, useEffect, useState } from 'react';
8
8
  import { jsx, css } from '@emotion/react';
9
- import { UNSAFE_Box as Box, UNSAFE_Text as Text } from '@atlaskit/ds-explorations';
10
- import Inline from '@atlaskit/primitives/inline';
11
- import Stack from '@atlaskit/primitives/stack';
9
+ import { UNSAFE_Text as Text } from '@atlaskit/ds-explorations';
10
+ import { Inline, Stack, Box, xcss } from '@atlaskit/primitives';
12
11
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
13
12
  import noop from '@atlaskit/ds-lib/noop';
14
13
  import FocusRing from '@atlaskit/focus-ring';
@@ -17,10 +16,28 @@ import { flagTextColor, flagBackgroundColor, flagIconColor } from './theme';
17
16
  import Actions from './flag-actions';
18
17
  import { useFlagGroup } from './flag-group';
19
18
  import { Expander, DismissButton } from './internal';
19
+ var CSS_VAR_ICON_COLOR = '--flag-icon-color';
20
+ var iconWrapperStyles = css({
21
+ display: 'flex',
22
+ alignItems: 'start',
23
+ flexShrink: 0,
24
+ color: "var(".concat(CSS_VAR_ICON_COLOR, ")")
25
+ });
26
+ var flagStyles = xcss({
27
+ boxShadow: 'overlay',
28
+ borderRadius: 'radius.100',
29
+ overflow: 'hidden',
30
+ zIndex: 'flag',
31
+ width: '100%',
32
+ transition: 'background-color 200ms'
33
+ });
34
+ var flagWrapperStyles = css({
35
+ width: '100%'
36
+ });
20
37
  var analyticsAttributes = {
21
38
  componentName: 'flag',
22
39
  packageName: "@atlaskit/flag",
23
- packageVersion: "15.2.4"
40
+ packageVersion: "15.2.6"
24
41
  };
25
42
  var transitionStyles = css({
26
43
  flexGrow: 1,
@@ -110,29 +127,21 @@ var Flag = function Flag(props) {
110
127
  var iconColor = flagIconColor[appearance];
111
128
  var isDismissable = isBold || isDismissAllowed;
112
129
  var shouldRenderGap = !isBold && (description || actions.length) || isExpanded;
113
- return jsx(FocusRing, null, jsx(Box, _extends({
114
- display: "block",
130
+ return jsx(FocusRing, null, jsx("div", _extends({
131
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
132
+ tabIndex: 0,
133
+ role: "alert",
134
+ css: flagWrapperStyles,
135
+ "data-testid": testId
136
+ }, autoDismissProps), jsx(Box, {
115
137
  backgroundColor: flagBackgroundColor[appearance],
116
- shadow: "overlay",
117
138
  padding: "space.200",
118
- borderRadius: "normal",
119
- overflow: "hidden",
120
- layer: "flag",
121
- UNSAFE_style: {
122
- width: '100%',
123
- transition: 'background-color 200ms'
124
- },
125
- role: "alert",
126
- tabIndex: 0,
127
- testId: testId
128
- }, autoDismissProps), jsx(Inline, {
139
+ xcss: flagStyles
140
+ }, jsx(Inline, {
129
141
  space: "space.200"
130
- }, jsx(Box, {
131
- alignItems: "start",
132
- UNSAFE_style: {
133
- color: iconColor,
134
- flexShrink: 0
135
- }
142
+ }, jsx("div", {
143
+ css: iconWrapperStyles,
144
+ style: _defineProperty({}, CSS_VAR_ICON_COLOR, iconColor)
136
145
  }, icon), jsx("span", {
137
146
  css: transitionStyles
138
147
  }, jsx(Stack, {
@@ -141,10 +150,7 @@ var Flag = function Flag(props) {
141
150
  space: "space.100",
142
151
  spread: "space-between"
143
152
  }, jsx(Box, {
144
- display: "block",
145
- UNSAFE_style: {
146
- paddingTop: "var(--ds-space-025, 2px)"
147
- }
153
+ paddingBlockStart: "space.025"
148
154
  }, jsx(Text, {
149
155
  color: textColor,
150
156
  fontWeight: "semibold",
@@ -176,6 +182,6 @@ var Flag = function Flag(props) {
176
182
  appearance: appearance,
177
183
  linkComponent: linkComponent,
178
184
  testId: testId
179
- })))))));
185
+ }))))))));
180
186
  };
181
187
  export default Flag;
@@ -1,12 +1,24 @@
1
1
  /** @jsx jsx */
2
2
  import { memo } from 'react';
3
- import { jsx } from '@emotion/react';
4
- import { UNSAFE_Box as Box } from '@atlaskit/ds-explorations';
3
+ import { css, jsx } from '@emotion/react';
5
4
  import FocusRing from '@atlaskit/focus-ring';
6
5
  import ChevronDownIcon from '@atlaskit/icon/glyph/hipchat/chevron-down';
7
6
  import ChevronUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-up';
8
7
  import CrossIcon from '@atlaskit/icon/glyph/cross';
9
8
  import { flagTextColorToken } from '../theme';
9
+ var buttonStyles = css({
10
+ display: 'flex',
11
+ width: '24px',
12
+ height: '24px',
13
+ padding: "var(--ds-space-0, 0px)",
14
+ alignItems: 'center',
15
+ justifyContent: 'center',
16
+ flex: '0 0 auto',
17
+ background: 'none',
18
+ borderStyle: 'none',
19
+ cursor: 'pointer',
20
+ whiteSpace: 'nowrap'
21
+ });
10
22
  var DismissButton = function DismissButton(_ref) {
11
23
  var appearance = _ref.appearance,
12
24
  onClick = _ref.onClick,
@@ -23,25 +35,12 @@ var DismissButton = function DismissButton(_ref) {
23
35
  size = 'medium';
24
36
  buttonTestId = testId && "".concat(testId, "-toggle");
25
37
  }
26
- return jsx(FocusRing, null, jsx(Box, {
27
- as: "button",
38
+ return jsx(FocusRing, null, jsx("button", {
28
39
  type: "button",
29
- justifyContent: "center",
30
- alignItems: "center",
31
- borderStyle: "none",
32
- borderRadius: "normal",
33
- padding: "space.0",
34
- width: "size.200",
35
- height: "size.200",
40
+ css: buttonStyles,
36
41
  onClick: onClick,
37
42
  "aria-expanded": isBold ? isExpanded : undefined,
38
- UNSAFE_style: {
39
- flex: '0 0 auto',
40
- background: 'none',
41
- cursor: 'pointer',
42
- whiteSpace: 'nowrap'
43
- },
44
- testId: buttonTestId
43
+ "data-testid": buttonTestId
45
44
  }, jsx(ButtonIcon, {
46
45
  label: buttonLabel,
47
46
  size: size,
@@ -1,8 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
- import { UNSAFE_Box as Box } from '@atlaskit/ds-explorations';
4
- import Stack from '@atlaskit/primitives/stack';
3
+ import { xcss, Stack, Box } from '@atlaskit/primitives';
5
4
  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
+ });
6
11
  var Expander = function Expander(_ref) {
7
12
  var children = _ref.children,
8
13
  isExpanded = _ref.isExpanded,
@@ -12,11 +17,11 @@ var Expander = function Expander(_ref) {
12
17
  // the the reveal because we don't know the height of the content.
13
18
 
14
19
  return /*#__PURE__*/React.createElement(Box, {
15
- UNSAFE_style: {
16
- minWidth: 0,
20
+ xcss: containerStyles,
21
+ style: {
17
22
  maxHeight: isExpanded ? 150 : 0,
18
23
  flex: '1 1 100%',
19
- transition: "max-height 0.3s"
24
+ minWidth: 0
20
25
  },
21
26
  "aria-hidden": !isExpanded,
22
27
  testId: testId && "".concat(testId, "-expander")
@@ -24,10 +29,7 @@ var Expander = function Expander(_ref) {
24
29
  appear: true
25
30
  }, isExpanded && /*#__PURE__*/React.createElement(FadeIn, null, function (props) {
26
31
  return /*#__PURE__*/React.createElement(Box, _extends({
27
- display: "block",
28
- UNSAFE_style: {
29
- width: '100%'
30
- }
32
+ xcss: expanderStyles
31
33
  }, props), /*#__PURE__*/React.createElement(Stack, {
32
34
  space: "space.100"
33
35
  }, children));
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "15.2.4",
3
+ "version": "15.2.6",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,3 @@
1
- /** @jsx jsx */
2
1
  import { ReactElement } from 'react';
3
2
  import { jsx } from '@emotion/react';
4
3
  import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
@@ -1,4 +1,5 @@
1
- import { UNSAFE_BoxProps as BoxProps, UNSAFE_TextProps as TextProps } from '@atlaskit/ds-explorations';
1
+ import { UNSAFE_TextProps as TextProps } from '@atlaskit/ds-explorations';
2
+ import { BoxProps } from '@atlaskit/primitives';
2
3
  import { AppearanceTypes } from './types';
3
4
  export declare const flagBackgroundColor: Record<AppearanceTypes, BoxProps['backgroundColor']>;
4
5
  export declare const flagIconColor: Record<AppearanceTypes, string>;
@@ -1,4 +1,3 @@
1
- /** @jsx jsx */
2
1
  import { ReactElement } from 'react';
3
2
  import { jsx } from '@emotion/react';
4
3
  import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
@@ -1,4 +1,5 @@
1
- import { UNSAFE_BoxProps as BoxProps, UNSAFE_TextProps as TextProps } from '@atlaskit/ds-explorations';
1
+ import { UNSAFE_TextProps as TextProps } from '@atlaskit/ds-explorations';
2
+ import { BoxProps } from '@atlaskit/primitives';
2
3
  import { AppearanceTypes } from './types';
3
4
  export declare const flagBackgroundColor: Record<AppearanceTypes, BoxProps['backgroundColor']>;
4
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": "15.2.4",
3
+ "version": "15.2.6",
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/"
@@ -24,7 +24,7 @@
24
24
  "atlaskit:src": "src/index.tsx",
25
25
  "atlassian": {
26
26
  "team": "Design System Team",
27
- "releaseModel": "scheduled",
27
+ "releaseModel": "continuous",
28
28
  "website": {
29
29
  "name": "Flag",
30
30
  "category": "Components"
@@ -50,7 +50,7 @@
50
50
  "@atlaskit/icon": "^21.12.0",
51
51
  "@atlaskit/motion": "^1.4.0",
52
52
  "@atlaskit/portal": "^4.3.0",
53
- "@atlaskit/primitives": "^0.9.0",
53
+ "@atlaskit/primitives": "*",
54
54
  "@atlaskit/theme": "^12.5.0",
55
55
  "@atlaskit/tokens": "^1.5.0",
56
56
  "@atlaskit/visually-hidden": "^1.2.0",
@@ -0,0 +1,126 @@
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
+
7
+ /// <reference types="react" />
8
+
9
+ import { ComponentType } from 'react';
10
+ import { CustomThemeButtonProps } from '@atlaskit/button/types';
11
+ import { FC } from 'react';
12
+ import { jsx } from '@emotion/react';
13
+ import { MouseEventHandler } from 'react';
14
+ import { default as React_2 } from 'react';
15
+ import { ReactElement } from 'react';
16
+ import { ReactNode } from 'react';
17
+ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
18
+ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
19
+
20
+ // @public (undocumented)
21
+ export type ActionsType = Array<ActionType>;
22
+
23
+ // @public (undocumented)
24
+ type ActionType = {
25
+ content: ReactNode;
26
+ onClick?: (e: React.MouseEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
27
+ href?: string;
28
+ target?: string;
29
+ testId?: string;
30
+ };
31
+
32
+ // @public (undocumented)
33
+ export type AppearanceTypes = 'error' | 'info' | 'normal' | 'success' | 'warning';
34
+
35
+ // @public
36
+ export const AutoDismissFlag: (props: AutoDismissFlagProps) => JSX.Element;
37
+
38
+ // @public (undocumented)
39
+ interface AutoDismissFlagProps extends AutoDismissFlagPropsWithoutId, FlagPropsId {
40
+ }
41
+
42
+ // @public (undocumented)
43
+ type AutoDismissFlagPropsWithoutId = {
44
+ actions?: ActionsType;
45
+ appearance?: AppearanceTypes;
46
+ description?: ReactNode;
47
+ icon: ReactNode;
48
+ title: ReactNode;
49
+ onDismissed?: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
50
+ linkComponent?: ComponentType<CustomThemeButtonProps>;
51
+ testId?: string;
52
+ analyticsContext?: Record<string, any>;
53
+ };
54
+
55
+ // @public (undocumented)
56
+ type Combine<First, Second> = Omit<First, keyof Second> & Second;
57
+
58
+ // @public (undocumented)
59
+ export interface CreateFlagArgs extends FlagPropsWithoutId {
60
+ id?: FlagId;
61
+ isAutoDismiss?: boolean;
62
+ }
63
+
64
+ // @public (undocumented)
65
+ export type DismissFn = () => void;
66
+
67
+ // @public
68
+ const Flag: FC<FlagProps>;
69
+ export default Flag;
70
+
71
+ // @public (undocumented)
72
+ export type FlagAPI = {
73
+ showFlag: (args: CreateFlagArgs) => DismissFn;
74
+ };
75
+
76
+ // @public (undocumented)
77
+ export type FlagArgs = Combine<CreateFlagArgs, {
78
+ id: FlagId;
79
+ }>;
80
+
81
+ // @public
82
+ export const FlagGroup: (props: FlagGroupProps) => jsx.JSX.Element;
83
+
84
+ // @public (undocumented)
85
+ type FlagGroupProps = {
86
+ id?: string;
87
+ label?: string;
88
+ labelTag?: React.ElementType;
89
+ children?: Array<ReactElement> | ReactElement | boolean | null;
90
+ onDismissed?: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
91
+ };
92
+
93
+ // @public (undocumented)
94
+ type FlagId = number | string;
95
+
96
+ // @public (undocumented)
97
+ export interface FlagProps extends FlagPropsWithoutId, FlagPropsId {
98
+ }
99
+
100
+ // @public (undocumented)
101
+ type FlagPropsId = {
102
+ id: number | string;
103
+ };
104
+
105
+ // @public (undocumented)
106
+ interface FlagPropsWithoutId extends AutoDismissFlagPropsWithoutId, WithAnalyticsEventsProps {
107
+ onBlur?: (e: React.FocusEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
108
+ onFocus?: (e: React.FocusEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
109
+ onMouseOut?: MouseEventHandler;
110
+ onMouseOver?: MouseEventHandler;
111
+ }
112
+
113
+ // @public (undocumented)
114
+ export function FlagsProvider({ children }: {
115
+ children: React_2.ReactNode;
116
+ }): JSX.Element;
117
+
118
+ // @public
119
+ export function useFlags(): FlagAPI;
120
+
121
+ // @public (undocumented)
122
+ export const withFlagsProvider: (fn: () => React_2.ReactNode) => React_2.ReactNode;
123
+
124
+ // (No @packageDocumentation comment for this package)
125
+
126
+ ```