@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.
- package/CHANGELOG.md +27 -0
- package/dist/cjs/auto-dismiss-flag.js +1 -1
- package/dist/cjs/constants.js +2 -6
- package/dist/cjs/flag-actions.compiled.css +17 -0
- package/dist/cjs/flag-actions.js +31 -57
- package/dist/cjs/flag-group.compiled.css +17 -0
- package/dist/cjs/flag-group.js +26 -78
- package/dist/cjs/flag.compiled.css +21 -0
- package/dist/cjs/flag.js +48 -76
- package/dist/cjs/internal/dismiss-button.compiled.css +15 -0
- package/dist/cjs/internal/dismiss-button.js +17 -18
- package/dist/cjs/internal/expander.compiled.css +2 -0
- package/dist/cjs/internal/expander.js +19 -15
- package/dist/es2019/auto-dismiss-flag.js +1 -1
- package/dist/es2019/constants.js +1 -5
- package/dist/es2019/flag-actions.compiled.css +17 -0
- package/dist/es2019/flag-actions.js +18 -57
- package/dist/es2019/flag-group.compiled.css +17 -0
- package/dist/es2019/flag-group.js +24 -78
- package/dist/es2019/flag.compiled.css +21 -0
- package/dist/es2019/flag.js +40 -75
- package/dist/es2019/internal/dismiss-button.compiled.css +15 -0
- package/dist/es2019/internal/dismiss-button.js +16 -17
- package/dist/es2019/internal/expander.compiled.css +2 -0
- package/dist/es2019/internal/expander.js +11 -10
- package/dist/esm/auto-dismiss-flag.js +1 -1
- package/dist/esm/constants.js +1 -5
- package/dist/esm/flag-actions.compiled.css +17 -0
- package/dist/esm/flag-actions.js +29 -55
- package/dist/esm/flag-group.compiled.css +17 -0
- package/dist/esm/flag-group.js +24 -78
- package/dist/esm/flag.compiled.css +21 -0
- package/dist/esm/flag.js +43 -77
- package/dist/esm/internal/dismiss-button.compiled.css +15 -0
- package/dist/esm/internal/dismiss-button.js +16 -17
- package/dist/esm/internal/expander.compiled.css +2 -0
- package/dist/esm/internal/expander.js +11 -10
- package/dist/types/constants.d.ts +0 -4
- package/dist/types/flag-group.d.ts +2 -3
- package/dist/types/internal/dismiss-button.d.ts +2 -2
- package/dist/types/internal/expander.d.ts +2 -2
- package/dist/types/theme.d.ts +1 -1
- package/dist/types-ts4.5/constants.d.ts +0 -4
- package/dist/types-ts4.5/flag-group.d.ts +2 -3
- package/dist/types-ts4.5/internal/dismiss-button.d.ts +2 -2
- package/dist/types-ts4.5/internal/expander.d.ts +2 -2
- package/dist/types-ts4.5/theme.d.ts +1 -1
- package/package.json +16 -15
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* dismiss-button.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -6,27 +7,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
7
|
value: true
|
|
7
8
|
});
|
|
8
9
|
exports.default = void 0;
|
|
10
|
+
require("./dismiss-button.compiled.css");
|
|
9
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var React = _react;
|
|
13
|
+
var _runtime = require("@compiled/react/runtime");
|
|
10
14
|
var _closeCross = _interopRequireDefault(require("@atlaskit/icon/core/migration/close--cross"));
|
|
11
15
|
var _chevronDownHipchatChevronDown = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down--hipchat-chevron-down"));
|
|
12
16
|
var _chevronUpHipchatChevronUp = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-up--hipchat-chevron-up"));
|
|
13
|
-
var
|
|
17
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
14
18
|
var _theme = require("../theme");
|
|
15
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
height: '24px',
|
|
21
|
-
padding: 'space.0',
|
|
22
|
-
alignItems: 'center',
|
|
23
|
-
justifyContent: 'center',
|
|
24
|
-
flex: '0 0 auto',
|
|
25
|
-
background: 'none',
|
|
26
|
-
borderStyle: 'none',
|
|
27
|
-
cursor: 'pointer',
|
|
28
|
-
whiteSpace: 'nowrap'
|
|
29
|
-
});
|
|
21
|
+
var styles = {
|
|
22
|
+
button: "_16jlidpf _1o9zidpf _i0dl1wug _1dqoglyw _1e0c1txw _1bsb1tcg _4t3i1tcg _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _4cvr1h6o _1bah1h6o _80omtlke _o5721q9c"
|
|
23
|
+
};
|
|
30
24
|
var DismissButtonComponent = function DismissButtonComponent(_ref) {
|
|
31
25
|
var appearance = _ref.appearance,
|
|
32
26
|
onClick = _ref.onClick,
|
|
@@ -43,13 +37,18 @@ var DismissButtonComponent = function DismissButtonComponent(_ref) {
|
|
|
43
37
|
size = 'medium';
|
|
44
38
|
buttonTestId = testId && "".concat(testId, "-toggle");
|
|
45
39
|
}
|
|
46
|
-
return /*#__PURE__*/
|
|
47
|
-
xcss:
|
|
48
|
-
onClick: onClick
|
|
40
|
+
return /*#__PURE__*/React.createElement(_compiled.Pressable, {
|
|
41
|
+
xcss: styles.button,
|
|
42
|
+
onClick: onClick
|
|
43
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
44
|
+
,
|
|
45
|
+
style: {
|
|
46
|
+
background: 'none'
|
|
47
|
+
},
|
|
49
48
|
"aria-expanded": isBold ? isExpanded : undefined,
|
|
50
49
|
testId: buttonTestId,
|
|
51
50
|
"aria-label": buttonLabel
|
|
52
|
-
}, /*#__PURE__*/
|
|
51
|
+
}, /*#__PURE__*/React.createElement(ButtonIcon, {
|
|
53
52
|
label: "",
|
|
54
53
|
LEGACY_size: size,
|
|
55
54
|
LEGACY_primaryColor: _theme.flagTextColorToken[appearance],
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
+
/* expander.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
Object.defineProperty(exports, "__esModule", {
|
|
5
7
|
value: true
|
|
6
8
|
});
|
|
7
9
|
exports.default = void 0;
|
|
10
|
+
require("./expander.compiled.css");
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _runtime = require("@compiled/react/runtime");
|
|
8
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _primitives = require("@atlaskit/primitives");
|
|
11
14
|
var _motion = require("@atlaskit/motion");
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
});
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
+
var styles = {
|
|
19
|
+
expander: "_1bsb1osq",
|
|
20
|
+
container: "_v5641xzp"
|
|
21
|
+
};
|
|
18
22
|
var Expander = function Expander(_ref) {
|
|
19
23
|
var children = _ref.children,
|
|
20
24
|
isExpanded = _ref.isExpanded,
|
|
@@ -23,8 +27,8 @@ var Expander = function Expander(_ref) {
|
|
|
23
27
|
// reveal transition doesn't happen. We can't use CSS animation for
|
|
24
28
|
// the the reveal because we don't know the height of the content.
|
|
25
29
|
|
|
26
|
-
return /*#__PURE__*/
|
|
27
|
-
xcss:
|
|
30
|
+
return /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
31
|
+
xcss: styles.expander,
|
|
28
32
|
style: {
|
|
29
33
|
maxHeight: isExpanded ? 150 : 0,
|
|
30
34
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
@@ -34,12 +38,12 @@ var Expander = function Expander(_ref) {
|
|
|
34
38
|
},
|
|
35
39
|
"aria-hidden": !isExpanded,
|
|
36
40
|
testId: testId && "".concat(testId, "-expander")
|
|
37
|
-
}, /*#__PURE__*/
|
|
41
|
+
}, /*#__PURE__*/React.createElement(_motion.ExitingPersistence, {
|
|
38
42
|
appear: true
|
|
39
|
-
}, isExpanded && /*#__PURE__*/
|
|
40
|
-
return /*#__PURE__*/
|
|
41
|
-
xcss:
|
|
42
|
-
}, props), /*#__PURE__*/
|
|
43
|
+
}, isExpanded && /*#__PURE__*/React.createElement(_motion.FadeIn, null, function (props) {
|
|
44
|
+
return /*#__PURE__*/React.createElement(_compiled.Box, (0, _extends2.default)({
|
|
45
|
+
xcss: styles.container
|
|
46
|
+
}, props), /*#__PURE__*/React.createElement(_compiled.Stack, {
|
|
43
47
|
space: "space.100"
|
|
44
48
|
}, children));
|
|
45
49
|
})));
|
|
@@ -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 = "
|
|
8
|
+
const packageVersion = "17.0.0";
|
|
9
9
|
export const AUTO_DISMISS_SECONDS = 8;
|
|
10
10
|
|
|
11
11
|
/**
|
package/dist/es2019/constants.js
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
export const DEFAULT_APPEARANCE = 'normal';
|
|
2
|
-
export const VAR_COLOR = '--color';
|
|
3
|
-
export const VAR_BG_COLOR = '--bg-color';
|
|
4
|
-
export const VAR_BG_COLOR_HOVER = '--bg-color-hover';
|
|
5
|
-
export const VAR_BG_COLOR_ACTIVE = '--bg-color-active';
|
|
1
|
+
export const DEFAULT_APPEARANCE = 'normal';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
._nup91zz4._nup91zz4, a._u4iq1zz4._u4iq1zz4{background:var(--bg-color)}
|
|
3
|
+
._12r21wq8._12r21wq8, a._il101wq8._il101wq8{font-weight:var(--ds-font-weight-medium,500)}
|
|
4
|
+
._1bk61a66._1bk61a66, a._1wy61a66._1wy61a66{padding-inline-end:var(--ds-space-100,8px)!important}
|
|
5
|
+
._1dltgrf3._1dltgrf3, a._h03xgrf3._h03xgrf3{padding-top:0!important}
|
|
6
|
+
._1g4l107e._1g4l107e, a._y8dn107e._y8dn107e{transform:translateX(-2px)}
|
|
7
|
+
._1ku2grf3._1ku2grf3, a._1v8mgrf3._1v8mgrf3{padding-block-end:0!important}
|
|
8
|
+
._1w901pkf._1w901pkf, a._qkwg1pkf._qkwg1pkf{color:var(--color)!important}
|
|
9
|
+
._1yxxgrf3._1yxxgrf3, a._z7cdgrf3._z7cdgrf3{padding-left:0!important}
|
|
10
|
+
._b3g31a66._b3g31a66, a._eqps1a66._eqps1a66{padding-inline-start:var(--ds-space-100,8px)!important}
|
|
11
|
+
._fjwrgrf3._fjwrgrf3, a._cwkngrf3._cwkngrf3{padding-bottom:0!important}
|
|
12
|
+
._gbuigrf3._gbuigrf3, a._1dwvgrf3._1dwvgrf3{padding-block-start:0!important}
|
|
13
|
+
._w8sqgrf3._w8sqgrf3, a._1iysgrf3._1iysgrf3{padding-right:0!important}
|
|
14
|
+
._u1mb14jz._u1mb14jz:hover{background-color:var(--bg-color-hover)}._10fu17w4._10fu17w4:active{background-color:var(--bg-color-active)}
|
|
15
|
+
._17rj8stv._17rj8stv:active, ._1p6m8stv._1p6m8stv:hover, a._5kwq8stv._5kwq8stv:active, a._1pd88stv._1pd88stv:hover{text-decoration-line:underline}
|
|
16
|
+
._1iqunqa1._1iqunqa1:active, ._1ejunqa1._1ejunqa1:hover, a._b6ztnqa1._b6ztnqa1:active, a._1rsgnqa1._1rsgnqa1:hover{text-decoration-style:solid}
|
|
17
|
+
._ow071r31._ow071r31:active, ._1p6b1r31._1p6b1r31:hover, a._8dbm1r31._8dbm1r31:active, a._77mc1r31._77mc1r31:hover{text-decoration-color:currentColor}
|
|
@@ -1,54 +1,15 @@
|
|
|
1
|
+
/* flag-actions.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
/* eslint-disable @atlaskit/design-system/no-nested-styles */
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { css, jsx } from '@emotion/react';
|
|
3
|
+
import "./flag-actions.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
9
6
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
10
|
-
import Inline from '@atlaskit/primitives/
|
|
11
|
-
import { DEFAULT_APPEARANCE
|
|
7
|
+
import { Inline } from '@atlaskit/primitives/compiled';
|
|
8
|
+
import { DEFAULT_APPEARANCE } from './constants';
|
|
12
9
|
import { actionBackgroundColor, actionTextColor } from './theme';
|
|
13
|
-
const buttonStyles =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
17
|
-
padding: `0 ${"var(--ds-space-100, 8px)"} !important`,
|
|
18
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
19
|
-
background: `var(${VAR_BG_COLOR})`,
|
|
20
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
21
|
-
color: `var(${VAR_COLOR}) !important`,
|
|
22
|
-
fontWeight: "var(--ds-font-weight-medium, 500)"
|
|
23
|
-
},
|
|
24
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
25
|
-
'&&:hover, &&:active, a&&:hover, a&&:active': {
|
|
26
|
-
textDecoration: 'underline'
|
|
27
|
-
},
|
|
28
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
29
|
-
'&&:hover': {
|
|
30
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
31
|
-
backgroundColor: `var(${VAR_BG_COLOR_HOVER})`
|
|
32
|
-
},
|
|
33
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
34
|
-
'&&:active': {
|
|
35
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
36
|
-
backgroundColor: `var(${VAR_BG_COLOR_ACTIVE})`
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
const appearanceNormalButtonStyles = css({
|
|
40
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
41
|
-
'&&, a&&': {
|
|
42
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
43
|
-
padding: '0 !important'
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
const appearanceNormalActionsContainerStyles = css({
|
|
47
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
48
|
-
'&&, a&&': {
|
|
49
|
-
transform: 'translateX(-2px)'
|
|
50
|
-
}
|
|
51
|
-
});
|
|
10
|
+
const buttonStyles = null;
|
|
11
|
+
const appearanceNormalButtonStyles = null;
|
|
12
|
+
const appearanceNormalActionsContainerStyles = null;
|
|
52
13
|
const FlagActions = props => {
|
|
53
14
|
const {
|
|
54
15
|
appearance = DEFAULT_APPEARANCE,
|
|
@@ -60,15 +21,15 @@ const FlagActions = props => {
|
|
|
60
21
|
return null;
|
|
61
22
|
}
|
|
62
23
|
const isBold = appearance !== DEFAULT_APPEARANCE;
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
},
|
|
24
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
25
|
+
className: ax([!isBold && "_1g4l107e _y8dn107e"])
|
|
26
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
66
27
|
space: "space.100",
|
|
67
28
|
shouldWrap: true,
|
|
68
29
|
alignBlock: "center",
|
|
69
30
|
separator: isBold ? undefined : '·',
|
|
70
31
|
testId: testId && `${testId}-actions`
|
|
71
|
-
}, actions.map((action, index) =>
|
|
32
|
+
}, actions.map((action, index) => /*#__PURE__*/React.createElement(Button, {
|
|
72
33
|
onClick: action.onClick,
|
|
73
34
|
href: action.href,
|
|
74
35
|
target: action.target,
|
|
@@ -79,18 +40,18 @@ const FlagActions = props => {
|
|
|
79
40
|
key: index,
|
|
80
41
|
style: {
|
|
81
42
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
82
|
-
|
|
43
|
+
'--color': actionTextColor[appearance],
|
|
83
44
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
84
|
-
|
|
45
|
+
'--bg-color': actionBackgroundColor[appearance].default,
|
|
85
46
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
86
|
-
|
|
47
|
+
'--bg-color-hover': actionBackgroundColor[appearance].pressed,
|
|
87
48
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
88
|
-
|
|
49
|
+
'--bg-color-active': actionBackgroundColor[appearance].active
|
|
89
50
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
90
51
|
}
|
|
91
52
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
92
53
|
,
|
|
93
|
-
|
|
54
|
+
className: ax(["_nup91zz4 _u4iq1zz4 _1w901pkf _qkwg1pkf _12r21wq8 _il101wq8 _1ku2grf3 _1v8mgrf3 _gbuigrf3 _1dwvgrf3 _1bk61a66 _1wy61a66 _b3g31a66 _eqps1a66 _ow071r31 _1p6b1r31 _8dbm1r31 _77mc1r31 _17rj8stv _1p6m8stv _5kwq8stv _1pd88stv _1iqunqa1 _1ejunqa1 _b6ztnqa1 _1rsgnqa1 _u1mb14jz _10fu17w4", appearance === DEFAULT_APPEARANCE && "_1dltgrf3 _h03xgrf3 _w8sqgrf3 _1iysgrf3 _fjwrgrf3 _cwkngrf3 _1yxxgrf3 _z7cdgrf3"])
|
|
94
55
|
}, action.content))));
|
|
95
56
|
};
|
|
96
57
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
._v5641b8g{transition:transform .35s ease-in-out}
|
|
3
|
+
._v564glyw{transition:none}._12a7luct._12a7luct+*{transition-duration:175ms}
|
|
4
|
+
._1bsb1kdj{width:25pc}
|
|
5
|
+
._1e021epz{inset-inline-start:var(--ds-space-1000,5pc)}
|
|
6
|
+
._1pbyegat{z-index:4}
|
|
7
|
+
._1pbyqfx8{z-index:5}
|
|
8
|
+
._1pbyxejw{z-index:flag}
|
|
9
|
+
._3um015vq{visibility:hidden}
|
|
10
|
+
._5sag5cps{animation-duration:0ms}
|
|
11
|
+
._kqsw1n9t{position:fixed}
|
|
12
|
+
._kqswstnw{position:absolute}
|
|
13
|
+
._t9ec1hw2{transform:translateX(0) translateY(100%) translateY(1pc)}
|
|
14
|
+
._t9ec1ygq{transform:translate(0,0)}
|
|
15
|
+
._u7coidpf{inset-block-end:0}
|
|
16
|
+
._u7cooahv{inset-block-end:var(--ds-space-600,3pc)}
|
|
17
|
+
@media (max-width:560px){._1eqkauwl{width:100vw}._1iafidpf{inset-block-end:0}._il0widpf{inset-inline-start:0}}
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/* flag-group.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./flag-group.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
5
|
import { Children, createContext, useContext, useMemo } from 'react';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { css, jsx } from '@emotion/react';
|
|
10
6
|
import noop from '@atlaskit/ds-lib/noop';
|
|
11
|
-
import {
|
|
7
|
+
import { ExitingPersistence, SlideIn } from '@atlaskit/motion';
|
|
12
8
|
import Portal from '@atlaskit/portal';
|
|
13
9
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
14
|
-
import {
|
|
10
|
+
import { layers } from '@atlaskit/theme/constants';
|
|
15
11
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
16
|
-
const
|
|
17
|
-
export const flagWidth = gridSize * 50;
|
|
12
|
+
export const flagWidth = 400;
|
|
18
13
|
const defaultFlagGroupContext = {
|
|
19
14
|
onDismissed: noop,
|
|
20
15
|
isDismissAllowed: false
|
|
@@ -30,65 +25,18 @@ export function useFlagGroup() {
|
|
|
30
25
|
|
|
31
26
|
// transition: none is set on first-of-type to prevent a bug in Firefox
|
|
32
27
|
// that causes a broken transition
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// TODO: Use new breakpoints
|
|
41
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
42
|
-
'@media (max-width: 560px)': {
|
|
43
|
-
width: '100vw'
|
|
44
|
-
},
|
|
45
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
46
|
-
':first-of-type': {
|
|
47
|
-
transform: `translate(0,0)`,
|
|
48
|
-
transition: 'none'
|
|
49
|
-
},
|
|
50
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
51
|
-
':nth-of-type(n + 2)': {
|
|
52
|
-
animationDuration: '0ms',
|
|
53
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
54
|
-
transform: `translateX(0) translateY(100%) translateY(${2 * gridSize}px)`
|
|
55
|
-
},
|
|
56
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
57
|
-
':nth-of-type(1)': {
|
|
58
|
-
zIndex: 5
|
|
59
|
-
},
|
|
60
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
61
|
-
':nth-of-type(2)': {
|
|
62
|
-
zIndex: 4
|
|
63
|
-
},
|
|
64
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
65
|
-
'&:nth-of-type(n + 4)': {
|
|
66
|
-
visibility: 'hidden'
|
|
67
|
-
}
|
|
68
|
-
});
|
|
28
|
+
const groupStyles = {
|
|
29
|
+
root: "_v5641b8g _1bsb1kdj _kqswstnw _u7coidpf _1eqkauwl",
|
|
30
|
+
first: "_v564glyw _t9ec1ygq _1pbyqfx8",
|
|
31
|
+
second: "_1pbyegat",
|
|
32
|
+
nth: "_5sag5cps _t9ec1hw2",
|
|
33
|
+
hidden: "_3um015vq"
|
|
34
|
+
};
|
|
69
35
|
|
|
70
36
|
// Transform needed to push up while 1st flag is leaving
|
|
71
37
|
// Exiting time should match the exiting time of motion so is halved
|
|
72
|
-
const dismissAllowedStyles =
|
|
73
|
-
|
|
74
|
-
'&& + *': {
|
|
75
|
-
transform: `translate(0, 0)`,
|
|
76
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
77
|
-
transitionDuration: `${exitingDurations.medium}ms`
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
const flagGroupContainerStyles = css({
|
|
81
|
-
position: 'fixed',
|
|
82
|
-
zIndex: 'flag',
|
|
83
|
-
insetBlockEnd: "var(--ds-space-600, 48px)",
|
|
84
|
-
insetInlineStart: "var(--ds-space-1000, 80px)",
|
|
85
|
-
// TODO: Use new breakpoints
|
|
86
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
87
|
-
'@media (max-width: 560px)': {
|
|
88
|
-
insetBlockEnd: 0,
|
|
89
|
-
insetInlineStart: 0
|
|
90
|
-
}
|
|
91
|
-
});
|
|
38
|
+
const dismissAllowedStyles = null;
|
|
39
|
+
const flagGroupContainerStyles = null;
|
|
92
40
|
|
|
93
41
|
/**
|
|
94
42
|
* __Flag group__
|
|
@@ -115,7 +63,7 @@ const FlagGroup = props => {
|
|
|
115
63
|
const renderChildren = () => {
|
|
116
64
|
return children && typeof children === 'object' ? Children.map(children, (flag, index) => {
|
|
117
65
|
const isDismissAllowed = index === 0;
|
|
118
|
-
return
|
|
66
|
+
return /*#__PURE__*/React.createElement(SlideIn, {
|
|
119
67
|
enterFrom: "left",
|
|
120
68
|
fade: "inout",
|
|
121
69
|
duration: "medium",
|
|
@@ -123,26 +71,24 @@ const FlagGroup = props => {
|
|
|
123
71
|
}, ({
|
|
124
72
|
className,
|
|
125
73
|
ref
|
|
126
|
-
}) =>
|
|
127
|
-
css: [baseStyles, isDismissAllowed && dismissAllowedStyles]
|
|
74
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
128
75
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
129
|
-
,
|
|
130
|
-
className: className,
|
|
76
|
+
className: ax([groupStyles.root, index === 0 && groupStyles.first, index === 1 && groupStyles.second, index >= 1 && groupStyles.nth, index >= 2 && groupStyles.hidden, isDismissAllowed && "_12a7luct", className]),
|
|
131
77
|
ref: ref
|
|
132
|
-
},
|
|
78
|
+
}, /*#__PURE__*/React.createElement(FlagGroupContext.Provider, {
|
|
133
79
|
value:
|
|
134
80
|
// Only the first flag should be able to be dismissed.
|
|
135
81
|
isDismissAllowed ? dismissFlagContext : defaultFlagGroupContext
|
|
136
82
|
}, flag)));
|
|
137
83
|
}) : false;
|
|
138
84
|
};
|
|
139
|
-
const flags =
|
|
85
|
+
const flags = /*#__PURE__*/React.createElement("div", {
|
|
140
86
|
id: id,
|
|
141
|
-
|
|
142
|
-
}, hasFlags ?
|
|
87
|
+
className: ax(["_kqsw1n9t _1pbyxejw _u7cooahv _1e021epz _1iafidpf _il0widpf"])
|
|
88
|
+
}, hasFlags ? /*#__PURE__*/React.createElement(VisuallyHidden, null, /*#__PURE__*/React.createElement(LabelTag, null, label)) : null, /*#__PURE__*/React.createElement(ExitingPersistence, {
|
|
143
89
|
appear: false
|
|
144
90
|
}, renderChildren()));
|
|
145
|
-
return shouldRenderToParent ? flags :
|
|
91
|
+
return shouldRenderToParent ? flags : /*#__PURE__*/React.createElement(Portal, {
|
|
146
92
|
zIndex: layers.flag()
|
|
147
93
|
}, flags);
|
|
148
94
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
._2rkosqtm{border-radius:var(--ds-border-radius-100,3px)}
|
|
3
|
+
._v5641hdc{transition:gap .3s}
|
|
4
|
+
._v564z97a{transition:background-color .2s}._16jlkb7n{flex-grow:1}
|
|
5
|
+
._16qs8sq4{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #091e423f,0 0 1px #091e424f)}
|
|
6
|
+
._18m915vq{overflow-y:hidden}
|
|
7
|
+
._18m91wug{overflow-y:auto}
|
|
8
|
+
._1bah1h6o{justify-content:center}
|
|
9
|
+
._1bsb1osq{width:100%}
|
|
10
|
+
._1e0c1txw{display:flex}
|
|
11
|
+
._1i4qfg65{overflow-wrap:anywhere}
|
|
12
|
+
._1o9zidpf{flex-shrink:0}
|
|
13
|
+
._1pbyni7l{z-index:600}
|
|
14
|
+
._1reo15vq{overflow-x:hidden}
|
|
15
|
+
._1reo1wug{overflow-x:auto}
|
|
16
|
+
._1tke1tcg{min-height:24px}
|
|
17
|
+
._1ul91tcg{min-width:24px}
|
|
18
|
+
._4cvr1h6o{align-items:center}
|
|
19
|
+
._4cvrv2br{align-items:start}
|
|
20
|
+
._c71l53f4{max-height:75pt}
|
|
21
|
+
._syaz1jn0{color:var(--flag-icon-color)}
|
package/dist/es2019/flag.js
CHANGED
|
@@ -1,70 +1,35 @@
|
|
|
1
|
+
/* flag.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
*/
|
|
3
|
+
import "./flag.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useCallback, useEffect, useState } from 'react';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { css, jsx } from '@emotion/react';
|
|
10
7
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
11
8
|
import noop from '@atlaskit/ds-lib/noop';
|
|
12
9
|
import Heading from '@atlaskit/heading';
|
|
13
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
|
-
import { Box, Inline, Stack
|
|
11
|
+
import { Box, Inline, Stack } from '@atlaskit/primitives/compiled';
|
|
15
12
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
16
13
|
import { DEFAULT_APPEARANCE } from './constants';
|
|
17
14
|
import Actions from './flag-actions';
|
|
18
15
|
import { useFlagGroup } from './flag-group';
|
|
19
16
|
import { DismissButton, Expander } from './internal';
|
|
20
17
|
import { flagBackgroundColor, flagIconColor, flagIconGlyph, flagTextColor, flagTextColorToken } from './theme';
|
|
18
|
+
const styles = {
|
|
19
|
+
overflowWrap: "_1i4qfg65",
|
|
20
|
+
flag: "_2rkosqtm _1reo15vq _18m915vq _v564z97a _16qs8sq4 _1pbyni7l _1bsb1osq"
|
|
21
|
+
};
|
|
21
22
|
const CSS_VAR_ICON_COLOR = '--flag-icon-color';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
});
|
|
27
|
-
const descriptionStyles = css({
|
|
28
|
-
maxHeight: 100,
|
|
29
|
-
// height is defined as 5 lines maximum by design
|
|
30
|
-
overflow: 'auto',
|
|
31
|
-
overflowWrap: 'anywhere' // For cases where a single word is longer than the container (e.g. filenames)
|
|
32
|
-
});
|
|
33
|
-
const oldIconWrapperStyles = css({
|
|
34
|
-
display: 'flex',
|
|
35
|
-
alignItems: 'start',
|
|
36
|
-
flexShrink: 0,
|
|
37
|
-
color: `var(${CSS_VAR_ICON_COLOR})`
|
|
38
|
-
});
|
|
39
|
-
const iconWrapperStyles = css({
|
|
40
|
-
display: 'flex',
|
|
41
|
-
minWidth: '24px',
|
|
42
|
-
minHeight: '24px',
|
|
43
|
-
alignItems: 'center',
|
|
44
|
-
justifyContent: 'center',
|
|
45
|
-
flexShrink: 0,
|
|
46
|
-
color: `var(${CSS_VAR_ICON_COLOR})`
|
|
47
|
-
});
|
|
48
|
-
const flagStyles = xcss({
|
|
49
|
-
boxShadow: 'elevation.shadow.overlay',
|
|
50
|
-
borderRadius: 'border.radius.100',
|
|
51
|
-
overflow: 'hidden',
|
|
52
|
-
zIndex: 'flag',
|
|
53
|
-
width: '100%',
|
|
54
|
-
transition: 'background-color 200ms'
|
|
55
|
-
});
|
|
56
|
-
const flagWrapperStyles = css({
|
|
57
|
-
width: '100%'
|
|
58
|
-
});
|
|
23
|
+
const descriptionStyles = null;
|
|
24
|
+
const oldIconWrapperStyles = null;
|
|
25
|
+
const iconWrapperStyles = null;
|
|
26
|
+
const flagWrapperStyles = null;
|
|
59
27
|
const analyticsAttributes = {
|
|
60
28
|
componentName: 'flag',
|
|
61
29
|
packageName: "@atlaskit/flag",
|
|
62
|
-
packageVersion: "
|
|
30
|
+
packageVersion: "17.0.0"
|
|
63
31
|
};
|
|
64
|
-
const transitionStyles =
|
|
65
|
-
flexGrow: 1,
|
|
66
|
-
transition: `gap 0.3s`
|
|
67
|
-
});
|
|
32
|
+
const transitionStyles = null;
|
|
68
33
|
|
|
69
34
|
/**
|
|
70
35
|
* __Flag__
|
|
@@ -158,64 +123,64 @@ const Flag = props => {
|
|
|
158
123
|
const isDismissable = isBold || isDismissAllowed;
|
|
159
124
|
const shouldRenderGap = !isBold && (description || actions.length) || isExpanded;
|
|
160
125
|
// when delayAnnouncement is available we will use a hidden content for announcement
|
|
161
|
-
const delayedAnnouncement = delayAnnouncement ?
|
|
162
|
-
return
|
|
126
|
+
const delayedAnnouncement = delayAnnouncement ? /*#__PURE__*/React.createElement(VisuallyHidden, null, title, description) : undefined;
|
|
127
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
163
128
|
role: "alert",
|
|
164
|
-
css: flagWrapperStyles,
|
|
165
129
|
"data-testid": testId
|
|
166
|
-
}, autoDismissProps
|
|
167
|
-
|
|
130
|
+
}, autoDismissProps, {
|
|
131
|
+
className: ax(["_1bsb1osq"])
|
|
132
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
168
133
|
padding: "space.200",
|
|
169
|
-
|
|
170
|
-
|
|
134
|
+
backgroundColor: flagBackgroundColor[appearance],
|
|
135
|
+
xcss: styles.flag
|
|
136
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
171
137
|
alignBlock: fg('platform_ads_component_no_icon_spacing_support') ? 'start' : 'stretch',
|
|
172
138
|
space: "space.200"
|
|
173
|
-
},
|
|
174
|
-
css: fg('platform_ads_component_no_icon_spacing_support') ? iconWrapperStyles : oldIconWrapperStyles
|
|
139
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
175
140
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
176
|
-
,
|
|
177
141
|
style: {
|
|
178
142
|
[CSS_VAR_ICON_COLOR]: iconColor
|
|
179
143
|
},
|
|
180
|
-
"data-testid": testId && `${testId}-icon-container
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
144
|
+
"data-testid": testId && `${testId}-icon-container`,
|
|
145
|
+
className: ax([fg('platform_ads_component_no_icon_spacing_support') ? "_1e0c1txw _1ul91tcg _1tke1tcg _4cvr1h6o _1bah1h6o _1o9zidpf _syaz1jn0" : "_1e0c1txw _4cvrv2br _1o9zidpf _syaz1jn0"])
|
|
146
|
+
}, icon || (iconGlyph && fg('platform_ads_component_no_icon_spacing_support') ? iconGlyph : null)), /*#__PURE__*/React.createElement("span", {
|
|
147
|
+
className: ax(["_v5641hdc _16jlkb7n"])
|
|
148
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
184
149
|
space: shouldRenderGap ? 'space.100' : 'space.0' // Gap exists even when not expanded due to Expander internals always being in the DOM
|
|
185
|
-
}, isDelayToAnnounce && delayedAnnouncement,
|
|
150
|
+
}, isDelayToAnnounce && delayedAnnouncement, /*#__PURE__*/React.createElement(Inline, {
|
|
186
151
|
alignBlock: "stretch",
|
|
187
152
|
space: "space.100",
|
|
188
153
|
spread: "space-between"
|
|
189
|
-
},
|
|
154
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
190
155
|
paddingBlockStart: "space.050",
|
|
191
156
|
paddingBlockEnd: "space.025",
|
|
192
|
-
xcss:
|
|
193
|
-
},
|
|
157
|
+
xcss: styles.overflowWrap
|
|
158
|
+
}, /*#__PURE__*/React.createElement(Heading, {
|
|
194
159
|
as: `h${headingLevel}`,
|
|
195
160
|
size: "xsmall",
|
|
196
161
|
color: textColor
|
|
197
|
-
},
|
|
162
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
198
163
|
/* if isDelayToAnnounce is true, we will hide the content form screen reader to avoid duplicate announcement */
|
|
199
164
|
"aria-hidden": isDelayToAnnounce
|
|
200
|
-
}, title))), isDismissable ? !(isBold && !description && !actions.length) &&
|
|
165
|
+
}, title))), isDismissable ? !(isBold && !description && !actions.length) && /*#__PURE__*/React.createElement(DismissButton, {
|
|
201
166
|
testId: testId,
|
|
202
167
|
appearance: appearance,
|
|
203
168
|
isBold: isBold,
|
|
204
169
|
isExpanded: isExpanded,
|
|
205
170
|
onClick: isBold ? toggleExpand : buttonActionCallback
|
|
206
|
-
}) : null),
|
|
171
|
+
}) : null), /*#__PURE__*/React.createElement(Expander, {
|
|
207
172
|
isExpanded: !isBold || isExpanded,
|
|
208
173
|
testId: testId
|
|
209
|
-
}, description &&
|
|
174
|
+
}, description && /*#__PURE__*/React.createElement("div", {
|
|
210
175
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
211
176
|
style: {
|
|
212
177
|
color: flagTextColorToken[appearance]
|
|
213
178
|
},
|
|
214
|
-
css: descriptionStyles,
|
|
215
179
|
"data-testid": testId && `${testId}-description`
|
|
216
180
|
/* if isDelayToAnnounce is true, we will hide the content form screen reader to avoid duplicate announcement */,
|
|
217
|
-
"aria-hidden": isDelayToAnnounce
|
|
218
|
-
|
|
181
|
+
"aria-hidden": isDelayToAnnounce,
|
|
182
|
+
className: ax(["_1reo1wug _18m91wug _c71l53f4 _1i4qfg65"])
|
|
183
|
+
}, description), /*#__PURE__*/React.createElement(Actions, {
|
|
219
184
|
actions: actions,
|
|
220
185
|
appearance: appearance,
|
|
221
186
|
linkComponent: linkComponent,
|