@atlaskit/flag 15.2.5 → 15.2.7
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 +13 -0
- package/dist/cjs/auto-dismiss-flag.js +1 -1
- package/dist/cjs/flag-group.js +7 -17
- package/dist/cjs/flag.js +37 -31
- package/dist/cjs/internal/dismiss-button.js +16 -17
- package/dist/cjs/internal/expander.js +14 -12
- package/dist/cjs/theme.js +4 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/auto-dismiss-flag.js +1 -1
- package/dist/es2019/flag-group.js +8 -17
- package/dist/es2019/flag.js +36 -28
- package/dist/es2019/internal/dismiss-button.js +17 -18
- package/dist/es2019/internal/expander.js +11 -9
- package/dist/es2019/theme.js +4 -4
- package/dist/es2019/version.json +1 -1
- package/dist/esm/auto-dismiss-flag.js +1 -1
- package/dist/esm/flag-group.js +8 -17
- package/dist/esm/flag.js +35 -29
- package/dist/esm/internal/dismiss-button.js +17 -18
- package/dist/esm/internal/expander.js +11 -9
- package/dist/esm/theme.js +4 -4
- package/dist/esm/version.json +1 -1
- package/dist/types/flag-group.d.ts +0 -1
- package/dist/types/theme.d.ts +2 -1
- package/dist/types-ts4.5/flag-group.d.ts +0 -1
- package/dist/types-ts4.5/theme.d.ts +2 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/flag
|
|
2
2
|
|
|
3
|
+
## 15.2.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b8b41649492`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b8b41649492) - Update how certain background colors are referenced by name. Internal changes only.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 15.2.6
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`779727e307a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/779727e307a) - Internal change only. Replace all instances of Box with stable @atlaskit/primitives version.
|
|
15
|
+
|
|
3
16
|
## 15.2.5
|
|
4
17
|
|
|
5
18
|
### 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.
|
|
18
|
+
var packageVersion = "15.2.7";
|
|
19
19
|
var AUTO_DISMISS_SECONDS = 8;
|
|
20
20
|
|
|
21
21
|
/**
|
package/dist/cjs/flag-group.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
bottom:
|
|
85
|
-
|
|
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)(
|
|
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)(
|
|
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
|
|
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: 'elevation.shadow.overlay',
|
|
34
|
+
borderRadius: 'border.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.
|
|
46
|
+
packageVersion: "15.2.7"
|
|
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)(
|
|
120
|
-
|
|
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
|
-
|
|
125
|
-
|
|
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)(
|
|
137
|
-
|
|
138
|
-
|
|
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)(
|
|
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)(
|
|
155
|
+
}, (0, _react2.jsx)(_primitives.Inline, {
|
|
147
156
|
space: "space.100",
|
|
148
157
|
spread: "space-between"
|
|
149
|
-
}, (0, _react2.jsx)(
|
|
150
|
-
|
|
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)(
|
|
35
|
-
as: "button",
|
|
46
|
+
return (0, _react2.jsx)(_focusRing.default, null, (0, _react2.jsx)("button", {
|
|
36
47
|
type: "button",
|
|
37
|
-
|
|
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
|
-
|
|
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
|
|
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(
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
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(
|
|
34
|
-
|
|
35
|
-
|
|
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
|
})));
|
package/dist/cjs/theme.js
CHANGED
|
@@ -8,11 +8,11 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
8
8
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
9
9
|
|
|
10
10
|
var flagBackgroundColor = {
|
|
11
|
-
error: 'danger.bold',
|
|
12
|
-
info: 'neutral.bold',
|
|
11
|
+
error: 'color.background.danger.bold',
|
|
12
|
+
info: 'color.background.neutral.bold',
|
|
13
13
|
normal: 'elevation.surface.overlay',
|
|
14
|
-
success: 'success.bold',
|
|
15
|
-
warning: 'warning.bold'
|
|
14
|
+
success: 'color.background.success.bold',
|
|
15
|
+
warning: 'color.background.warning.bold'
|
|
16
16
|
};
|
|
17
17
|
exports.flagBackgroundColor = flagBackgroundColor;
|
|
18
18
|
var flagIconColor = {
|
package/dist/cjs/version.json
CHANGED
|
@@ -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.
|
|
8
|
+
const packageVersion = "15.2.7";
|
|
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
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
bottom:
|
|
71
|
-
|
|
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(
|
|
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(
|
|
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, {
|
package/dist/es2019/flag.js
CHANGED
|
@@ -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 {
|
|
6
|
-
import Inline from '@atlaskit/primitives
|
|
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: 'elevation.shadow.overlay',
|
|
24
|
+
borderRadius: 'border.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.
|
|
36
|
+
packageVersion: "15.2.7"
|
|
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(
|
|
106
|
-
|
|
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
|
-
|
|
111
|
-
|
|
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(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
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(
|
|
28
|
-
as: "button",
|
|
39
|
+
return jsx(FocusRing, null, jsx("button", {
|
|
29
40
|
type: "button",
|
|
30
|
-
|
|
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
|
-
|
|
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 {
|
|
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
|
-
|
|
17
|
-
|
|
21
|
+
xcss: containerStyles,
|
|
22
|
+
style: {
|
|
18
23
|
maxHeight: isExpanded ? 150 : 0,
|
|
19
24
|
flex: '1 1 100%',
|
|
20
|
-
|
|
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
|
-
|
|
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)))));
|
package/dist/es2019/theme.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import { B400, N0, N30A, N500, N700 } from '@atlaskit/theme/colors';
|
|
4
4
|
export const flagBackgroundColor = {
|
|
5
|
-
error: 'danger.bold',
|
|
6
|
-
info: 'neutral.bold',
|
|
5
|
+
error: 'color.background.danger.bold',
|
|
6
|
+
info: 'color.background.neutral.bold',
|
|
7
7
|
normal: 'elevation.surface.overlay',
|
|
8
|
-
success: 'success.bold',
|
|
9
|
-
warning: 'warning.bold'
|
|
8
|
+
success: 'color.background.success.bold',
|
|
9
|
+
warning: 'color.background.warning.bold'
|
|
10
10
|
};
|
|
11
11
|
export const flagIconColor = {
|
|
12
12
|
error: `var(--ds-icon-inverse, ${N0})`,
|
package/dist/es2019/version.json
CHANGED
|
@@ -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.
|
|
8
|
+
var packageVersion = "15.2.7";
|
|
9
9
|
export var AUTO_DISMISS_SECONDS = 8;
|
|
10
10
|
|
|
11
11
|
/**
|
package/dist/esm/flag-group.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
bottom:
|
|
72
|
-
|
|
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(
|
|
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(
|
|
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 {
|
|
10
|
-
import Inline from '@atlaskit/primitives
|
|
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: 'elevation.shadow.overlay',
|
|
28
|
+
borderRadius: 'border.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.
|
|
40
|
+
packageVersion: "15.2.7"
|
|
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(
|
|
114
|
-
|
|
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
|
-
|
|
119
|
-
|
|
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(
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
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(
|
|
27
|
-
as: "button",
|
|
38
|
+
return jsx(FocusRing, null, jsx("button", {
|
|
28
39
|
type: "button",
|
|
29
|
-
|
|
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
|
-
|
|
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 {
|
|
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
|
-
|
|
16
|
-
|
|
20
|
+
xcss: containerStyles,
|
|
21
|
+
style: {
|
|
17
22
|
maxHeight: isExpanded ? 150 : 0,
|
|
18
23
|
flex: '1 1 100%',
|
|
19
|
-
|
|
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
|
-
|
|
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));
|
package/dist/esm/theme.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import { B400, N0, N30A, N500, N700 } from '@atlaskit/theme/colors';
|
|
4
4
|
export var flagBackgroundColor = {
|
|
5
|
-
error: 'danger.bold',
|
|
6
|
-
info: 'neutral.bold',
|
|
5
|
+
error: 'color.background.danger.bold',
|
|
6
|
+
info: 'color.background.neutral.bold',
|
|
7
7
|
normal: 'elevation.surface.overlay',
|
|
8
|
-
success: 'success.bold',
|
|
9
|
-
warning: 'warning.bold'
|
|
8
|
+
success: 'color.background.success.bold',
|
|
9
|
+
warning: 'color.background.warning.bold'
|
|
10
10
|
};
|
|
11
11
|
export var flagIconColor = {
|
|
12
12
|
error: "var(--ds-icon-inverse, ".concat(N0, ")"),
|
package/dist/esm/version.json
CHANGED
package/dist/types/theme.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
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,5 @@
|
|
|
1
|
-
import {
|
|
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.
|
|
3
|
+
"version": "15.2.7",
|
|
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/"
|
|
@@ -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": "
|
|
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",
|